InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DVOwnerDrawMenu.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Kevin Van Wiel
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 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 __DVOwnerDrawMenu__
25 #define __DVOwnerDrawMenu__
26 
27 #include "IDVOwnerDrawMenu.h"
28 #include <map>
29 
30 class IControlView;
31 
32 #ifdef DV_WIDGET_BUILD
33 #endif
34 
35 class DV_ DVOwnerDrawMenu : public CPMUnknown<IDVOwnerDrawMenu>
36 {
37 public:
39 
40  virtual void DrawMenuItem(IGraphicsContext *oc, ActionID menuActionID, const SysRect& itemRect, bool16 isCurrentlySelectedItem, int16 actionState);
41 
42  virtual void MeasureItem(ActionID menuActionID, uint16* outItemWidth, uint16* outItemHeight);
43 
44  virtual void AddMenuWidget( ActionID menuActionID, IControlView* widget );
45  virtual void RemoveMenuWidget( ActionID menuActionID, bool16 deleteUID = kTrue );
46  virtual void RemoveAllMenuWidgets( bool16 deleteUID = kTrue );
47 
48  virtual bool16 IsValidActionID(ActionID actionID);
49 
50  virtual PMReal GetMenuViewScale();
51  virtual void SetMenuViewScale(PMReal scale);
52 
53  virtual void ReadWrite(IPMStream *s, ImplementationID prop);
54 
55 protected:
56  IControlView *GetWidgetForAction(ActionID menuActionID);
57  virtual void DrawHilite(dvaui::drawbot::Drawbot *drawbotP, IControlView* menuView, bool16 isCurrentlySelectedItem);
58  virtual void HandleEnablement(IControlView* menuView, int16 actionState);
59 
60 private:
61  std::map<ActionID, int32> fActionToIndexMap;
62  PMReal fScale;
63 };
64 
65 
66 #endif //__DVOwnerDrawMenu__