VisibleTemplateHandler Class Reference

Provides the user with something tangible in the way of WizOp's. They can appear in a list control via this class. More...

Inheritance diagram for VisibleTemplateHandler:

AvailableProperty VisibleListItem UserInterface List of all members.

Public Member Functions

 VisibleTemplateHandler (const WizOp &Handler)
 Constructs us a WizOp that can be on the screen (this is all horribly wrong).
 VisibleTemplateHandler (const VisibleTemplateHandler &Other)
 Warns that I haven't done either of these (but I did do a destructor).
VisibleTemplateHandleroperator= (const VisibleTemplateHandler &Other)
 ~VisibleTemplateHandler ()
 Destructor gets rid of any working visible attribute.
virtual BOOL Display (DialogOp &Dialog)
 Displays the UI associated with this VisibleTemplateHandler.
virtual BOOL Interact (DialogOp &Dialog)
 Displays the UI associated with this VisibleTemplateHandler. It creates a new VisibleTemplateAttribute which is binned if the user selects another "Available Property" without Adding it (via hide), otherwise it's supplied via CreateUsedProperty() to the Applied Properties list.
virtual void Hide ()
 Hides whatever was displayed by Display().
virtual StringBaseGetText (StringBase &Description) const
 Creates some text suitable for putting in the "Available Properties" list.
virtual AppliedAttributeCreateUsedProperty ()
 Creates an item suitable for adding to the "Used Properties" list.
virtual BOOL CanBecomeStyle () const
virtual StyleMakeStyle (const StringBase &StyleName)

Protected Member Functions

const WizOpGetWizOp () const
const StringBaseGetWorkingQuestion ()
const StringBaseGetWorkingParam ()

Private Member Functions

 CC_DECLARE_MEMDUMP (VisibleTemplateHandler)

Private Attributes

const WizOpm_Handler
VisibleTemplateAttributem_pWorkingVisibleAttr

Detailed Description

Provides the user with something tangible in the way of WizOp's. They can appear in a list control via this class.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96

Definition at line 218 of file tmpltdlg.cpp.


Constructor & Destructor Documentation

VisibleTemplateHandler::VisibleTemplateHandler const WizOp Handler  ) 
 

Constructs us a WizOp that can be on the screen (this is all horribly wrong).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 776 of file tmpltdlg.cpp.

00776                                                                    : 
00777     m_Handler(Handler), 
00778     m_pWorkingVisibleAttr(NULL)
00779 {
00780 }

VisibleTemplateHandler::VisibleTemplateHandler const VisibleTemplateHandler Other  ) 
 

Warns that I haven't done either of these (but I did do a destructor).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 794 of file tmpltdlg.cpp.

00794                                                                                   : 
00795     m_Handler(Other.m_Handler), 
00796     m_pWorkingVisibleAttr(NULL)
00797 {
00798     TRACE( _T("VisibleTemplateHandler copy constructor not implemented\n"));
00799 }

VisibleTemplateHandler::~VisibleTemplateHandler  ) 
 

Destructor gets rid of any working visible attribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 818 of file tmpltdlg.cpp.

00819 {
00820     delete m_pWorkingVisibleAttr;
00821     m_pWorkingVisibleAttr = NULL;
00822 }


Member Function Documentation

virtual BOOL VisibleTemplateHandler::CanBecomeStyle  )  const [inline, virtual]
 

Implements AvailableProperty.

Definition at line 237 of file tmpltdlg.cpp.

00237 {   return TRUE;    }

VisibleTemplateHandler::CC_DECLARE_MEMDUMP VisibleTemplateHandler   )  [private]
 

AppliedAttribute * VisibleTemplateHandler::CreateUsedProperty  )  [virtual]
 

Creates an item suitable for adding to the "Used Properties" list.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
A new AppliedAttribute or derived class which is what Used Properties are. (Although this new one's not applied yet)

Implements AvailableProperty.

Definition at line 957 of file tmpltdlg.cpp.

00958 {
00959     AppliedAttribute* pNewAppliedAttr = NULL;
00960 
00961     if (m_pWorkingVisibleAttr != NULL)
00962     {
00963         m_pWorkingVisibleAttr->Hide();
00964         m_pWorkingVisibleAttr->MarkAsUsed();
00965 
00966         pNewAppliedAttr = new SingletonAppliedAttribute(*m_pWorkingVisibleAttr);
00967 
00968         if (pNewAppliedAttr != NULL)
00969         {
00970             // make sure Hide() doesn't throw the not-so-working VisibleAttribute away
00971             m_pWorkingVisibleAttr = NULL;
00972         }
00973     }
00974 
00975     return pNewAppliedAttr;
00976 }

BOOL VisibleTemplateHandler::Display DialogOp Dialog  )  [virtual]
 

Displays the UI associated with this VisibleTemplateHandler.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
Hmmm,,,,

Reimplemented from VisibleListItem.

Definition at line 859 of file tmpltdlg.cpp.

00860 {
00861     ERROR2IF(m_pWorkingVisibleAttr != NULL, FALSE, "VisibleTemplateHandler member should be NULL");
00862 
00863     BOOL Ok = TRUE;
00864 
00865     m_pWorkingVisibleAttr = new VisibleTemplateAttribute(m_Handler);
00866     Ok = (m_pWorkingVisibleAttr != NULL);
00867 
00868     if (Ok)
00869     {
00870         Ok = m_pWorkingVisibleAttr->Display(Dialog);
00871     }
00872 
00873     return Ok;
00874 }

StringBase & VisibleTemplateHandler::GetText StringBase Description  )  const [virtual]
 

Creates some text suitable for putting in the "Available Properties" list.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
(Change this) Description: The description of this VisibleTemplateHandler [OUTPUTS] that will appear to the user.
Returns:
A reference to the Text

Implements VisibleListItem.

Definition at line 840 of file tmpltdlg.cpp.

00841 {
00842     return Description = m_Handler.GetUserName();
00843 }

const WizOp& VisibleTemplateHandler::GetWizOp  )  const [inline, protected]
 

Definition at line 241 of file tmpltdlg.cpp.

00241 {   return m_Handler;   }

const StringBase & VisibleTemplateHandler::GetWorkingParam  )  [protected]
 

Definition at line 935 of file tmpltdlg.cpp.

00936 {
00937     STRING_ENSURE_NOT_NULL(m_pWorkingVisibleAttr)
00938 
00939     return m_pWorkingVisibleAttr->GetLongKey();
00940 }

const StringBase & VisibleTemplateHandler::GetWorkingQuestion  )  [protected]
 

Definition at line 927 of file tmpltdlg.cpp.

00928 {
00929     STRING_ENSURE_NOT_NULL(m_pWorkingVisibleAttr)
00930 
00931     return m_pWorkingVisibleAttr->GetValue();
00932 }

void VisibleTemplateHandler::Hide  )  [virtual]
 

Hides whatever was displayed by Display().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
Hmmm,,,,

Reimplemented from VisibleListItem.

Definition at line 917 of file tmpltdlg.cpp.

00918 {
00919     if (m_pWorkingVisibleAttr != NULL)
00920     {
00921         m_pWorkingVisibleAttr->Hide();
00922         delete m_pWorkingVisibleAttr;
00923         m_pWorkingVisibleAttr = NULL;
00924     }
00925 }

BOOL VisibleTemplateHandler::Interact DialogOp Dialog  )  [virtual]
 

Displays the UI associated with this VisibleTemplateHandler. It creates a new VisibleTemplateAttribute which is binned if the user selects another "Available Property" without Adding it (via hide), otherwise it's supplied via CreateUsedProperty() to the Applied Properties list.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
Hmmm,,,,

Reimplemented from VisibleListItem.

Definition at line 892 of file tmpltdlg.cpp.

00893 {
00894     BOOL Ok = TRUE;
00895 
00896     if (m_pWorkingVisibleAttr != NULL)
00897     {
00898         Ok = m_pWorkingVisibleAttr->Interact(Dialog);
00899     }
00900 
00901     return Ok;
00902 }

Style * VisibleTemplateHandler::MakeStyle const StringBase StyleName  )  [virtual]
 

Reimplemented from AvailableProperty.

Definition at line 980 of file tmpltdlg.cpp.

00981 {
00982     ERROR2IF(GetWorkingQuestion().IsEmpty(), NULL, "Empty Question");
00983 
00984     return new WizOpStyle(StyleName, GetWorkingQuestion(), GetWizOp(), GetWorkingParam());
00985 }

VisibleTemplateHandler & VisibleTemplateHandler::operator= const VisibleTemplateHandler Other  ) 
 

Definition at line 801 of file tmpltdlg.cpp.

00802 {
00803     TRACE( _T("VisibleTemplateHandler assignment operator not implemented\n"));
00804     return *this;
00805 }


Member Data Documentation

const WizOp& VisibleTemplateHandler::m_Handler [private]
 

Definition at line 246 of file tmpltdlg.cpp.

VisibleTemplateAttribute* VisibleTemplateHandler::m_pWorkingVisibleAttr [private]
 

Definition at line 247 of file tmpltdlg.cpp.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 04:03:03 2007 for Camelot by  doxygen 1.4.4