#include <cnamecol.h>
Inheritance diagram for CNamedColourReplacer:
Public Member Functions | |
CNamedColourReplacer () | |
Constructor. | |
CNamedColourReplacer (ColourFillAttribute *, DocColour *) | |
Constructor with initialisation. | |
~CNamedColourReplacer () | |
Destructor. | |
virtual BOOL | Initialise (ColourFillAttribute *, DocColour *) |
initialisation function. | |
virtual BOOL | IsInitialised () |
as above | |
virtual BOOL | ReplaceColours () |
This function asks the colour fill for its start colour, checks to see if they are named, or if they were created by a named colour. If so it copies them and stores them. It then replaces them with our replacement colour. | |
virtual BOOL | RestoreColours () |
This function assumes that ReplaceColours has been previously called. It uses its pointers to start and end colours to set colours in the attribute. | |
ColourFillAttribute * | GetColourFill () |
access fn. | |
BOOL | SetColourFill (ColourFillAttribute *) |
access fn. | |
DocColour * | GetReplacementColour () |
access fn. | |
BOOL | SetReplacementColour (DocColour *) |
access fn. | |
Protected Attributes | |
ColourFillAttribute * | m_pColourFill |
DocColour * | m_pReplaceColour |
DocColour | m_StartColour |
DocColour | m_EndColour1 |
DocColour | m_EndColour2 |
DocColour | m_EndColour3 |
Definition at line 126 of file cnamecol.h.
|
Constructor.
Definition at line 127 of file cnamecol.cpp. 00128 { 00129 m_pColourFill = NULL; 00130 m_pReplaceColour = NULL; 00131 }
|
|
Constructor with initialisation.
Definition at line 145 of file cnamecol.cpp. 00146 { 00147 // call the default constructor that NULLs all the member pointers 00148 CNamedColourReplacer::CNamedColourReplacer(); 00149 Initialise(pFillAttr, pColour); 00150 }
|
|
Destructor.
Definition at line 164 of file cnamecol.cpp.
|
|
access fn.
Definition at line 300 of file cnamecol.cpp. 00301 { 00302 return m_pColourFill; 00303 }
|
|
access fn.
Definition at line 341 of file cnamecol.cpp. 00342 { 00343 return m_pReplaceColour; 00344 }
|
|
initialisation function.
Definition at line 181 of file cnamecol.cpp. 00182 { 00183 if (pFillAttr == NULL || pColour == NULL) 00184 return FALSE; 00185 00186 m_pColourFill = pFillAttr; 00187 m_pReplaceColour = pColour; 00188 00189 return TRUE; 00190 }
|
|
as above
Reimplemented in CHSVChanger. Definition at line 205 of file cnamecol.cpp. 00206 { 00207 return ((m_pColourFill != NULL) && (m_pReplaceColour != NULL)); 00208 }
|
|
This function asks the colour fill for its start colour, checks to see if they are named, or if they were created by a named colour. If so it copies them and stores them. It then replaces them with our replacement colour.
Reimplemented in CHSVChanger. Definition at line 225 of file cnamecol.cpp. 00226 { 00227 // PORTNOTETRACE("other","CNamedColourReplacer::ReplaceColours - do nothing"); 00228 //#ifndef EXCLUDE_FROM_XARALX 00229 if (m_pColourFill == NULL || m_pReplaceColour == NULL) 00230 { 00231 ERROR3("CNamedColourReplacer not initialised correctly"); 00232 return FALSE; 00233 } 00234 00235 // we only replace the start colour, so as to maintain the effect on 00236 // 2/3/4 colour fills 00237 DocColour* pOrigStartCol = m_pColourFill->GetStartColour(); 00238 if (pOrigStartCol != NULL && pOrigStartCol->IsNamed()) 00239 { 00240 // we've got one, so stash the original and replace it 00241 m_StartColour = *pOrigStartCol; 00242 m_pColourFill->SetStartColour(m_pReplaceColour); 00243 00244 } 00245 00246 return TRUE; 00247 //#else 00248 // return FALSE; 00249 //#endif 00250 }
|
|
This function assumes that ReplaceColours has been previously called. It uses its pointers to start and end colours to set colours in the attribute.
Reimplemented in CHSVChanger. Definition at line 266 of file cnamecol.cpp. 00267 { 00268 // PORTNOTETRACE("other","CNamedColourReplacer::RestoreColours - do nothing"); 00269 //#ifndef EXCLUDE_FROM_XARALX 00270 if (m_pColourFill == NULL) 00271 { 00272 ERROR3("Colour fill is NULL in CNamedColourReplacer::RestoreColours"); 00273 return FALSE; 00274 } 00275 00276 // restore our colour 00277 if (m_StartColour.GetReservedFlag() == COL_NAMED) 00278 m_pColourFill->SetStartColour(&m_StartColour); 00279 00280 00281 return TRUE; 00282 //#else 00283 // return FALSE; 00284 //#endif 00285 }
|
|
access fn.
Definition at line 319 of file cnamecol.cpp. 00320 { 00321 if (pAttr == NULL) 00322 return FALSE; 00323 m_pColourFill = pAttr; 00324 return TRUE; 00325 }
|
|
access fn.
Definition at line 359 of file cnamecol.cpp. 00360 { 00361 if (pColour == NULL) 00362 return FALSE; 00363 m_pReplaceColour = pColour; 00364 return TRUE; 00365 }
|
|
Definition at line 156 of file cnamecol.h. |
|
Definition at line 157 of file cnamecol.h. |
|
Definition at line 158 of file cnamecol.h. |
|
Definition at line 153 of file cnamecol.h. |
|
Definition at line 154 of file cnamecol.h. |
|
Definition at line 155 of file cnamecol.h. |