InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IconHandler.h
1 //========================================================================================
2 //
3 // Copyright 2021 Adobe
4 // All Rights Reserved.
5 //
6 // NOTICE: Adobe permits you to use, modify, and distribute this file in
7 // accordance with the terms of the Adobe license agreement accompanying
8 // it.
9 //
10 //========================================================================================
11 
12 #ifndef __ICONHANDLER_H__
13 #define __ICONHANDLER_H__
14 
15 #include "BravoForwardDecl.h"
16 #include "IDFile.h"
17 #include "IArt.h"
18 
19 class IGraphicsPort;
20 
21 #ifdef PUBLIC_BUILD
22 #endif
23 
25 {
26 public :
27  IconHandler ();
28 
31  ~IconHandler ();
32 
46  bool SetRsrc (const PluginID & pid, const RsrcID & rid, const bool isRollOver, const bool isDark = false, const float scaleFactor = 1.0 ,const float iconScale=2.0);
47  bool SetRsrc (const RsrcSpec& spec, const float scaleFactor = 1.0, const float iconScale=2.0); // all decisions (light/dark/rollover/hiRes/etc.) resolved by caller
48 
55  bool SetFile (const IDFile& idFile,const float scaleFactor = 1.0, const float iconScale=2.0);
56 
63  void Draw (IGraphicsPort * gPort, const PMMatrix &imMatrix, int32 agmflags);
64 
67  void DrawDisabled (IGraphicsPort * gPort, const PMMatrix &imMatrix, int32 agmflags);
68 
72  bool HasAlpha ();
73 
77  bool IsLoaded ();
78 
81  void Delete ();
82 
85  int GetHeight () const;
86 
89  int GetWidth () const;
90 
93  AGMImageRecord* GetBitmap () const;
94 
95 private :
96  void LoadSVGHandler();
97  void LoadPNGHandler();
98  std::unique_ptr<IArt> fIconPtr;
99  PMReal fProxyScale;
100 };
101 
102 #ifdef PUBLIC_BUILD
103 #endif
104 
105 #endif