home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / fmfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  91 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. #ifndef __FORM_FILE_H
  20. #define __FORM_FILE_H
  21.  
  22. //    This file is dedicated to form type select one elements
  23. //        otherwise known as list boxes on windows and
  24. //        their implementation as requried by the XP layout
  25. //        library.
  26.  
  27. //    Required includes.
  28. #include "fmabstra.h"
  29. #include "odctrl.h"
  30.  
  31. class CFormFile : public CFormElement    {
  32. //    Construction/destruction.
  33. //    Do not construct directly, use GetFormElement instead.
  34. protected:
  35.     CFormFile();
  36.     virtual ~CFormFile();
  37.     friend CFormElement;
  38.  
  39. //    The form element we represent.
  40. //    This can be called at various times, so always update
  41. //        our information when this function is called
  42. //        (refresh cached or calculated XP data).
  43. protected:
  44.     virtual void SetElement(LO_FormElementStruct *pFormElement);
  45.  
  46. //    This is called to inform us of the owning context.
  47. //    Once set, we should query it to decide how we will represent our
  48. //        selves (printing through a DC, existing as a window, etc).
  49. protected:
  50.     virtual void SetContext(CAbstractCX *pCX);
  51.  
  52. //    Actions that we've been told to take.
  53. public:
  54.     virtual void DisplayFormElement(LTRB& Rect);
  55. protected:
  56.     //    Destroy the widget (window) implemenation of the form.
  57.     virtual void DestroyWidget();
  58.  
  59.     //    Create the widget (window) implementation of the form
  60.     //        but DO NOT DISPLAY.
  61.     virtual void CreateWidget();
  62.  
  63.     //    Copy the current data out of the layout struct into the form
  64.     //        widget, or mark that you should represent using the current data.
  65.     virtual void UseCurrentData();
  66.  
  67.     //    Copy the default data out of the layout struct into the form
  68.     //        widget, or mark that you should represent using the default data.
  69.     virtual void UseDefaultData();
  70.  
  71.     //    Fill in the layout size information in the layout struct regarding
  72.     //        the dimensions of the widget.
  73.     virtual void FillSizeInfo();
  74.  
  75.     //    Copy the current data out of the form element back into the
  76.     //        layout struct.
  77.     virtual void UpdateCurrentData();
  78.  
  79. public:
  80.     virtual HWND GetRaw();
  81.     virtual CWnd *GetSecondaryWidget();
  82.  
  83. //    The widgets representing this form element.
  84. private:
  85.     CODNetscapeEdit *m_pWidget;    //    the main widget.
  86.     CODNetscapeButton *m_pBrowse;    //    browse button.
  87.     CWnd *m_pWidgetOverride;    //    return dynamic values in GetRaw() call if this is set.
  88. };
  89.  
  90. #endif // __FORM_FILE_H
  91.