InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DVDropDownElementView.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Deepak Gupta
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2015 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __DVDropDownElementView__
25 #define __DVDropDownElementView__
26 
27 #include "DVAbstractControlView.h"
28 #include "IGraphicsPort.h"
29 
30 #ifdef DV_WIDGET_BUILD
31 #endif
32 
33 /******************************************************************************
34  * class DVDropDownElementView
35  ******************************************************************************/
36 class DVPanelDataReference;
38 {
40 public:
41  DVDropDownElementView(IPMUnknown *boss, bool16 dropDownInContrastMode = false);
42  virtual ~DVDropDownElementView() {}
43 
48  virtual void Draw(IViewPort *viewport, SysRgn updateRgn);
49 
53  virtual DVPanelDataReference *GetReference();
54 
59  virtual void Enable(bool16 doEnable, bool16 invalidate);
60 
64  virtual void Disable(bool16 invalidate);
65 
66 protected:
70  virtual bool16 IsElementHilited() const;
71 
75  bool16 IsDrawingAsDefaultItem() const;
76 
80  PMRect GetAdjustedFrame()const;
81 
86  virtual void DrawContent(IViewPort *viewport, SysRgn updateRgn) = 0;
87 
93  virtual void DrawBackground(IGraphicsPort* gPort, const PMRect& frameRect);
94 
95  /*
96  The default color to draw the background with. This will let the clients have a
97  custom color implementation instead of having to override the drawing.
98  */
99  virtual int32 GetDefaultBackgroundColorID() const;
100 
101  /*
102  The default color to use to hilite the elements on hover. This lets the clients choose
103  different color for hilite if they wish to.
104  */
105  virtual int32 GetDefaultHiliteColorID() const;
106 
107  /*
108  The content color with which the content should be drawn.
109  To match this with Illustrator, we are using black color for now.
110  */
111 
112  virtual int32 GetDefaultContentColorID() const ;
113 
114 private:
115  float GetThumbWidth()const;
116  float GetInset()const;
117 };
118 
119 
120 #endif //__DVDropDownElementView__