home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / SearchRuleView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.5 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.    SearchRuleView.h -- class definitions for search rule view.
  20.    Created: Dora Hsu <dora@netscape.com>, 15-Dec-96.
  21. */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_searchruleview_h
  26. #define _xfe_searchruleview_h
  27.  
  28. #include "MNView.h"
  29. #include "msg_srch.h"
  30. #include "xp_time.h"
  31. #include <Xm/Xm.h>
  32.  
  33. class XFE_SearchRuleView: public XFE_MNView
  34. {
  35.  
  36.  public:
  37.     XFE_SearchRuleView(XFE_Component *toplevel_component,
  38.                 Widget parent,
  39.                 XFE_View *parent_view,
  40.         MWContext *context,
  41.                 MSG_Pane *p,
  42.         char *title,
  43.         void *folderInfo,
  44.         MSG_ScopeAttribute curScope,
  45.         uint16 curAttrib);
  46.  
  47.     virtual ~XFE_SearchRuleView();
  48.       void setLabelWidth(Dimension width);
  49.     XP_Bool getSearchTerm( MSG_SearchAttribute *attr, 
  50.         MSG_SearchOperator *op, MSG_SearchValue *value,
  51.                            char* customHdr);
  52.     void resetSearchValue();
  53.     void changeScope(MSG_FolderInfo *folderInfo);
  54.     void adjustLeadingWidth (Dimension width);
  55.  
  56.     Dimension getLeadingWidth();
  57.     Dimension getHeight();
  58.     uint16 getAttributeIndex();
  59.  
  60.     void changeLabel(char* newlabel);
  61.  
  62.         static const char *activateSearch;
  63.     XFE_CALLBACK_DECL(afterRealizeWidget)
  64.     
  65.  protected:
  66.   void buildRules(Widget parent,
  67.          MSG_ScopeAttribute curScope,
  68.           uint16 newAttr,   
  69.         MSG_SearchMenuItem attrItems[], uint16 attrNum,
  70.         MSG_SearchMenuItem opItems[], uint16 opNum,
  71.         MSG_SearchValueWidget valueType );
  72.   char* getAttribLabel();   // used for custom headers -- free with XtFree()!
  73.  
  74.  private:
  75.  
  76.   Widget  makeOptionMenu(Widget parent, char* widgetName, Widget* popup);
  77.   Boolean needNewMenu(Widget pulldownParent,
  78.                         MSG_SearchMenuItem *opItems,
  79.                         uint16 opNum );
  80.  
  81.   void     initializeDataMember();
  82.   void     calculateSize();
  83.   void      createWidgets(Widget parent);
  84.   void   buildPulldownMenu(Widget pulldownParent,
  85.                         MSG_SearchMenuItem items[], uint16 itemNum,
  86.                         XtCallbackProc activeCB, XtPointer clientData);
  87.   void   resetHeaderOptions(char*);
  88.  
  89.   Widget   replaceValueField ( 
  90.         Widget valueField, 
  91.         Widget parent,
  92.                 MSG_SearchValueWidget valueType,
  93.                 XtCallbackProc callback, XtPointer clientData);
  94.  
  95.   void   setAttribOption(int16 attrib);
  96.   void   createValueWidgetSet(Widget parent);
  97.   void   editHeaders();
  98.   static void     attribOptionCallback(Widget w, 
  99.             XtPointer clientData, XtPointer callData);
  100.   static void   operatorOptionCallback(Widget w, 
  101.             XtPointer clientData, XtPointer callData);
  102.   static void     valueOptionCallback(Widget w, 
  103.             XtPointer clientData, XtPointer callData);
  104.   static void   typeActivateCallback(Widget, XtPointer, XtPointer);
  105.   static void editHdrCallback(Widget, XtPointer, XtPointer);
  106.  
  107.   //--------- Private Data member ----------------
  108.   
  109.   Visual*  m_visual;
  110.   Colormap m_cmap;
  111.   Cardinal m_depth;
  112.   char*       m_ruleTitle;
  113.   
  114.   Widget m_label;             /* label */
  115.   Widget m_attr_opt;           /* attribute option */
  116.   Widget m_attr_pop;           /* attribute option */
  117.   Widget m_op_opt;           /* operator option */
  118.   Widget m_op_pop;           /* operator option */
  119.   Widget m_value;              /* value option */
  120.  
  121.   Dimension m_width;           /* width  of the row */
  122.   Dimension m_height;          /* height of the row */
  123.  
  124.   MSG_ScopeAttribute m_curScope;
  125.   MSG_SearchAttribute m_attr;
  126.   MSG_SearchOperator  m_op;
  127.   MSG_SearchValueWidget m_type;
  128.   int32 m_value_option;  /* for the MSG value */
  129.   uint16 m_curAttribIndex;
  130.   char *m_textValue;
  131.   Widget m_opt_valueField;
  132.   Widget m_date_valueField;
  133.   Widget m_text_valueField;
  134.   Widget m_date_textField;
  135.   MSG_FolderInfo *m_folderInfo;
  136.   DIR_Server *m_dir; /* Index of the current selected ldap dir in the option list */
  137.   XFE_CALLBACK_DECL(scopeChanged)
  138. };
  139.  
  140. #endif
  141.