home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / prefs / CPrefsDialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.7 KB  |  141 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.  
  20. #include <PP_Types.h>
  21.  
  22. #pragma once
  23.  
  24. #include "PrefsPaneIDs.h"
  25.  
  26. class CMenuTable;
  27. class CPrefsMediator;
  28.  
  29.  
  30. //======================================
  31. class CPrefsDialog
  32. //======================================
  33. :    public LCommander
  34. ,    public LListener
  35. ,    public LBroadcaster
  36. {
  37.  
  38.     public:
  39.  
  40.     enum
  41.     {
  42.         cmd_Prefs                                = 12000
  43. ,        ePrefsTextTraits                        = 12000
  44. ,        ePrefsTableStrings                        = 12000
  45.     };
  46.  
  47.     enum
  48.     {
  49.         eOKButtonID = 8,
  50.         eCancelButtonID = 2,
  51.         eHelpButtonID,
  52.         eMainCaptionID,
  53.         eSubCaptionID,
  54.         ePanelView,
  55.         eTableView
  56.     };
  57.  
  58.     enum Expand_T    // note: Appearance is always expanded
  59.     {
  60.         eExpandAppearance = PrefPaneID::eAppearance_Main
  61.         , eExpandBrowser = PrefPaneID::eBrowser_Main
  62.         // Leave this in for Navigator only build to get email addr pref
  63.         , eExpandMailNews = PrefPaneID::eMailNews_Main
  64.         #ifdef EDITOR
  65.         , eExpandEditor = PrefPaneID::eEditor_Main
  66.         #endif
  67.         #ifdef MOZ_MAIL_NEWS
  68.         , eExpandOffline = PrefPaneID::eOffline_Main
  69.         #endif
  70.         #ifdef EDITOR
  71.         , eExpandAdvanced = PrefPaneID::eAdvanced_Main
  72.         #endif
  73.         
  74.     };
  75.  
  76.     enum Selection_T
  77.     {
  78.         eIgnore,
  79.         eEmailAddress,
  80.         ePOPUserID,
  81.         eSMTPHost,
  82.         ePOPHost,
  83.         eNewsHost
  84.     };
  85.  
  86.     enum
  87.     {
  88.         ePrefsChanged = 'prfx'
  89.     };
  90.  
  91.         static    void    RegisterViewClasses();
  92.         static    void    EditPrefs(    Expand_T expand = eExpandAppearance,
  93.                                     PrefPaneID::ID pane = PrefPaneID::eNoPaneSpecified,
  94.                                     Selection_T selection = eIgnore);
  95.         static    void    LoadICDependent();
  96.             // This class must know which managers are IC dependent. Ugh.
  97. //        static    void    AddPrefsListener(LListener *newPrefsListener);
  98.                             // The listener will receive the ePrefsChanged
  99.                             // message and the ioParam will be long * to
  100.                             // the value of the pref enum.
  101.                             // Note this notification is only for changes
  102.                             // generated by using the prefs UI. If there is
  103.                             // a possibility that the pref can be change
  104.                             // in another way, then a pref call back should
  105.                             // be registered with the xp prefs.
  106.  
  107.         virtual void        FindCommandStatus(CommandT inCommand,
  108.                             Boolean &outEnabled, Boolean &outUsesMark,
  109.                             Char16 &outMark, Str255 outName);
  110.  
  111.         virtual void    ListenToMessage(
  112.                             MessageT        inMessage,
  113.                             void            *ioParam);
  114.  
  115.         virtual    Boolean    AllowTargetSwitch(LCommander *inNewTarget);
  116.     private:
  117.                         CPrefsDialog();
  118.         virtual            ~CPrefsDialog();
  119.  
  120.                 void    DoPrefsWindow(    Expand_T expand = eExpandAppearance,
  121.                                         PrefPaneID::ID pane = PrefPaneID::eNoPaneSpecified,
  122.                                         Selection_T selection = eIgnore);
  123.  
  124.         CPrefsMediator     *GetMediator(ResIDT paneID);
  125.         Boolean                CheckMediator(ResIDT paneID) const;
  126.         CPrefsMediator*    FindMediator( ResIDT paneID );
  127.         
  128.         static    void    CheckForVCard();
  129.                 void    Finished();
  130.  
  131.         static    CPrefsDialog        *sThis;
  132.  
  133.         LWindow                            *mWindow;
  134.         CPrefsMediator                    *mCurrentMediator;
  135.         CMenuTable                        *mTable;
  136.         LView                            *mPanel;
  137.         Boolean                            mNeedToCheckForVCard;
  138.  
  139.         LArray                            mPanels;
  140. }; // class CPrefsDialog
  141.