InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PNGIcon.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard
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 // An icon class that draws itself (via AGM) without a widget
24 //
25 // This is a class that will draw an PNG based icon with the specified resource id.
26 // (Refactored from the old PlatformIconClass, after we dropped platform icon resources)
27 //
28 //========================================================================================
29 
30 #ifndef __PNGIcon__
31 #define __PNGIcon__
32 
33 #ifdef WIDGET_BUILD
34 #endif
35 
36 #include "IconHandler.h"
37 class IViewPort;
38 
42 class PNGIcon {
43 public:
44  PNGIcon();
45  ~PNGIcon();
46 
51  void ReadWrite(IPMStream* s, ImplementationID prop);
52 
60  void LoadIcon(const PluginID & pid, const RsrcID& iconRsrcID, bool brightnessAware = true, bool isAdornmentIcon = false);
61 
67  void Draw(IViewPort* viewPort, const SysRect& bbox, bool drawDisabled);
68 
75  static PNGIcon *CreateIcon(const PMRsrcID& inRsrcID, bool brightnesssAware = true, bool isAdornmentIcon = false);
79  ErrorCode DrawIcon(IGraphicsPort* graphicsPort);
80  SysRect GetBounds();
81 
82  RsrcID GetRsrcID(){ return fIconRsrcID; }
83  PluginID GetRsrcPluginID(){ return fPid; }
84  bool IsLoaded();
85 protected:
86  PluginID fPid;
87  RsrcID fIconRsrcID;
88 
89 private:
90  void LoadIcon(const PluginID & pid, const RsrcID& iconRsrcID, bool brightnessAware, float desiredRes);
91 
92  IconHandler fIcon;
93  float fLoadedRes;
94  float fDesiredRes;
95  bool fBrightnessAware;
96  bool fLoadedForBrightUI;
97  bool fIsAdornmentIcon;
98 };
99 
100 
101 #endif // __PNGIcon__