home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / utility / PrefControls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  64 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. #pragma once
  20.  
  21. #ifdef MOZ_MAIL_NEWS
  22. class CMessageFolder;
  23. #endif // MOZ_MAIL_NEWS
  24.  
  25. //======================================
  26. class UPrefControls
  27. // The control classes themselves are all private.  That's the point.  They know what
  28. // they're doing.
  29.  
  30. // So far, the family includes
  31. // CPrefTextEdit, CPrefCheckbox, CIntPrefRadio, and CBoolPrefRadio.  Each of these 
  32. // has a custom constructor template. 
  33. //
  34. // These can be added to any window (not just the preferences dialog).  You add the 
  35. // control to your window in constructor, put in the pref name (eg 
  36. // "browser.foo.bar.mumble") and a number called "mOrdinal". 
  37. //
  38. // In most cases, no code will be required.  The control initializes itself by querying 
  39. // the pref value during FinishCreate(), and updates the associated preference when 
  40. // destroyed.  The latter behavior is determined by a static function call that you 
  41. // should make if the user hits a "cancel" button. 
  42. //
  43. // The meaning of mOrdinal varies with the type of pane.  For a checkbox, mOrdinal 
  44. // is xored with the value when converting between the pref and the control value, 
  45. // allowing a checkbox to be worded in the same or the opposite sense to the pref's
  46. // semantic.  For a boolean radio button group, the one with mOrdinal == 0 corresponds
  47. // to the pref value and updates its corresponding pref, while the other one must have 
  48. // mOrdinal == 1.  For an int radio button group, the one whose ordinal matches the 
  49. // value of the pref gets turned on initially and on destruction, only the one that's 
  50. // on updates its corresponding pref to the value of its  mOrdinal field. 
  51. //
  52. // Future directions might include a popup menu control associated with an int 
  53. // value, an RGAColor pref control, etc. 
  54. //======================================
  55. {
  56. public:
  57.     static void        RegisterPrefControlViews();
  58. #ifdef MOZ_MAIL_NEWS
  59.     static void        NoteSpecialFolderChanged(
  60.                                 LControl* inControl,
  61.                                 int inKind, /* actually UFolderDialogs::FolderKind */
  62.                                 const CMessageFolder& inFolder);
  63. #endif // MOZ_MAIL_NEWS
  64. };