home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / UFormElementFactory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.8 KB  |  149 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. //    UFormElementFactory.h
  20.  
  21. #pragma once
  22.  
  23. // PowerPlant
  24. #include <PP_Types.h>
  25.  
  26. // Backend
  27. #include "ntypes.h"    // for LO_* struct typedefs
  28. #include "libi18n.h"
  29.  
  30. class CHTMLView;
  31. class CNSContext;
  32.  
  33. class UFormElementFactory
  34. {
  35. public:
  36. // Form Class Registration
  37.     static    void    RegisterFormTypes();
  38.     
  39. // Form Element Creation
  40.     static     void    MakeFormElem(
  41.                             CHTMLView* inHTMLView,
  42.                             CNSContext*    inNSContext,
  43.                             LO_FormElementStruct* formElem
  44.                             );
  45.  
  46.  
  47.  
  48.     static    LPane*    MakeTextFormElem(
  49.                             CHTMLView* inHTMLView,
  50.                             CNSContext*    inNSContext,
  51.                             Int32 &width,
  52.                             Int32 &height,
  53.                             Int32& baseline,
  54.                             LO_FormElementStruct *formElem
  55.                             );
  56.     static    LPane*    MakeReadOnlyFormElem(
  57.                             CHTMLView* inHTMLView,
  58.                             CNSContext*    inNSContext,
  59.                             Int32 &width,
  60.                             Int32 &height,
  61.                             Int32& baseline,
  62.                             LO_FormElementStruct *formElem
  63.                             );
  64.     static    LPane*    MakeTextArea(
  65.                             CHTMLView* inHTMLView,
  66.                             CNSContext*    inNSContext,
  67.                             Int32 &width,
  68.                             Int32 &height,
  69.                             Int32& baseline,
  70.                             LO_FormElementStruct *formElem
  71.                             );
  72.     static    LPane*    MakeButton(
  73.                             CHTMLView* inHTMLView,
  74.                             CNSContext* inNSContext,
  75.                             Int32 &width,
  76.                             Int32 &height,
  77.                             Int32& baseline,
  78.                             LO_FormElementStruct *formElem
  79.                             );
  80.     static    LPane*    MakeFilePicker(
  81.                             CHTMLView* inHTMLView,
  82.                             CNSContext* inNSContext,
  83.                             Int32 &width,
  84.                             Int32 &height,
  85.                             Int32& baseline,
  86.                             LO_FormElementStruct *formElem
  87.                             );
  88.     static    LPane*    MakeToggle(
  89.                             CHTMLView* inHTMLView,
  90.                             CNSContext* inNSContext,
  91.                             Int32 &width,
  92.                             Int32 &height,
  93.                             Int32& baseline,
  94.                             LO_FormElementStruct *formElem
  95.                             );
  96.     static    LPane*    MakePopup (
  97.                             CHTMLView* inHTMLView,
  98.                             CNSContext* inNSContext,
  99.                             Int32 &width,
  100.                             Int32 &height,
  101.                             Int32& baseline,
  102.                             LO_FormElementStruct *formElem
  103.                             );
  104.     static    LPane*    MakeList(
  105.                             CHTMLView* inHTMLView,
  106.                             CNSContext* inNSContext,
  107.                             Int32 &width,
  108.                             Int32 &height,
  109.                             Int32& baseline,
  110.                             LO_FormElementStruct *formElem
  111.                             );
  112.  
  113. // Form Element Destruction
  114.     static    void    FreeFormElement(
  115.                             LO_FormElementData *formElem
  116.                             );
  117.  
  118. // Utility Routines
  119.  
  120.     static    void    DisplayFormElement(
  121.                             CNSContext* inNSContext,
  122.                             LO_FormElementStruct* formElem
  123.                             );
  124.     static    void    ResetFormElement(
  125.                             LO_FormElementStruct *formElem,
  126.                             Boolean redraw,
  127.                             Boolean fromDefaults
  128.                             );
  129.     static    void    SetFormElementToggle(
  130.                             LO_FormElementStruct* formElem,
  131.                             Boolean value
  132.                             );
  133.     static    void    FormTextIsSubmit(
  134.                             LO_FormElementStruct * formElem
  135.                             );
  136.     static    void    GetFormElementValue(
  137.                             LO_FormElementStruct *formElem,
  138.                             Boolean hide
  139.                             );
  140.     static    void    HideFormElement(
  141.                             LO_FormElementStruct* formElem
  142.                             );
  143.     static    void    ResetFormElementData(
  144.                             LO_FormElementStruct *formElem,
  145.                             Boolean redraw,
  146.                             Boolean fromDefaults,
  147.                             Boolean reflect
  148.                             );
  149. };