00001
00015 #ifndef INC_MI32_COLORSPREAD_H
00016 #define INC_MI32_COLORSPREAD_H
00017
00018 #ifndef INC_MI32_MISTRING_H
00019 #include <mi32/mistring.h>
00020 #endif
00021
00022 #ifndef INC_MI32_COLOR_H
00023 #include <mi32/color.h>
00024 #endif
00025
00026 #ifndef GENERATING_DOXYGEN_OUTPUT
00027 class COLOR_ARRAY;
00028 class SERIALIZERITEM;
00029 #endif
00030
00032 class COLORSPREAD {
00033 public:
00034
00036 enum TYPE {
00037 TYPE_Manual = 0,
00038 TYPE_Standard = 1,
00039 TYPE_User = 2
00040 };
00041
00042 enum PATH {
00043 PATH_Longest = 0,
00044 PATH_RGB,
00045 PATH_HISCW,
00046 PATH_HISCCW,
00047 PATH_HBSCW,
00048 PATH_HBSCCW,
00049 PATH_COUNT
00050 };
00051
00053 static const SERIALIZERITEM* SerialGetItemDef ();
00054
00056 COLORSPREAD ();
00057
00059 ~COLORSPREAD ();
00060
00062 ERRVALUE ComputePalette (
00063 COLOR_ARRAY& palette,
00064 int NumColors
00065 ) const;
00066
00068 const COLOR& GetColorBegin () const
00069 { return (m_ColorBegin); }
00070
00072 const COLOR& GetColorEnd () const
00073 { return (m_ColorEnd); }
00074
00076 const MISTRING& GetName () const
00077 { return (m_Name); }
00078
00080 PATH GetPath () const
00081 { return (m_Path); }
00082
00084 TYPE GetType () const
00085 { return (m_Type); }
00086
00088 void IniRead (
00089 INIHANDLE *inihnd,
00090 const char *IniGroup,
00091 const char *IniName
00092 );
00093
00095 void IniWrite (
00096 INIHANDLE *inihnd,
00097 const char *IniGroup,
00098 const char *IniName
00099 ) const;
00100
00102 bool IsReversed () const
00103 { return (m_IsReversed); }
00104
00106 void SetColorBegin (
00107 const COLOR& color
00108 ) { m_ColorBegin = color; }
00109
00111 void SetColorEnd (
00112 const COLOR& color
00113 ) { m_ColorEnd = color; }
00114
00116 void SetManual (
00117 const COLOR& ColorBegin,
00118 const COLOR& ColorEnd,
00119 PATH path
00120 ) { m_Type = TYPE_Manual; m_ColorBegin = ColorBegin; m_ColorEnd = ColorEnd; m_Path = path; }
00121
00123 void SetNamed (
00124 const MISTRING& name,
00125 TYPE type = TYPE_Standard
00126 ) { m_Type = type; m_Name = name; }
00127
00129 void SetPath (
00130 PATH path
00131 ) { m_Path = path; }
00132
00134 void SetReversed (
00135 bool reversed
00136 ) { m_IsReversed = reversed; }
00137
00139 void SetType (
00140 TYPE type
00141 ) { m_Type = type; }
00142
00143 private:
00144 #ifndef GENERATING_DOXYGEN_OUTPUT
00145 TYPE m_Type;
00146 PATH m_Path;
00147 COLOR m_ColorBegin;
00148 COLOR m_ColorEnd;
00149 MISTRING m_Name;
00150 bool m_IsReversed;
00151 #endif
00152 };
00153
00154 #ifndef GENERATING_DOXYGEN_OUTPUT
00155 DEFINE_ENUM_OP_INCREMENT(COLORSPREAD::PATH)
00156 #endif
00157
00158 #endif // INC_MI32_COLORSPREAD_H
00159