Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

AP_Dialog_Styles Class Reference

#include <ap_Dialog_Styles.h>

Inheritance diagram for AP_Dialog_Styles:
XAP_Dialog_NonPersistent XAP_Dialog AP_UnixDialog_Styles AP_Win32Dialog_Styles

List of all members.

Public Types

enum  tAnswer { a_OK, a_CANCEL }
typedef std::map< std::string,
std::string > 
PropMap

Public Member Functions

 AP_Dialog_Styles (XAP_DialogFactory *pDlgFactory, XAP_Dialog_Id id)
virtual ~AP_Dialog_Styles (void)
virtual void runModal (XAP_Frame *pFrame)=0
AP_Dialog_Styles::tAnswer getAnswer (void) const
void _tabCallback (const char *, const char *)

Protected Member Functions

void event_paraPreviewUpdated (const gchar *pageLeftMargin, const gchar *pageRightMargin, const gchar *align, const gchar *firstLineIndent, const gchar *leftIndent, const gchar *rightIndent, const gchar *beforeSpacing, const gchar *afterSpacing, const gchar *lineSpacing) const
virtual void event_charPreviewUpdated (void) const
virtual const char * getCurrentStyle (void) const =0
virtual void setDescription (const char *desc) const =0
virtual void setModifyDescription (const char *desc)=0
virtual void _populatePreviews (bool isModify)
FV_ViewgetLView (void) const
PD_DocumentgetLDoc (void) const
void drawLocal (void)
void destroyAbiPreview (void)
void fillVecWithProps (const gchar *szStyle, bool bReplaceAttributes)
void fillVecFromCurrentPoint (void)
const gchar * getVecVal (const UT_Vector *v, const gchar *szProp) const
void ModifyLists (void)
void ModifyFont (void)
void ModifyParagraph (void)
void ModifyTabs (void)
void ModifyLang (void)
void updateCurrentStyle (void)
bool createNewStyle (const gchar *szName)
bool applyModifiedStyleToDoc (void)
void setDoc (PD_Document *pDoc)
void setFrame (XAP_Frame *pFrame)
void setView (FV_View *pView)
FV_ViewgetView (void) const
PD_DocumentgetDoc (void) const
XAP_FramegetFrame (void) const
void _createParaPreviewFromGC (GR_Graphics *gc, UT_uint32 width, UT_uint32 height)
void _createCharPreviewFromGC (GR_Graphics *gc, UT_uint32 width, UT_uint32 height)
void _createAbiPreviewFromGC (GR_Graphics *gc, UT_uint32 width, UT_uint32 height)
void _populateAbiPreview (bool isNew)

Protected Attributes

AP_Dialog_Styles::tAnswer m_answer
PD_Stylem_pCurStyle
char * m_pszCurStyleName
std::string m_curStyleDesc
AP_Preview_Paragraphm_pParaPreview
XAP_Preview_FontPreviewm_pCharPreview
AP_Preview_Abim_pAbiPreview
PP_PropertyVector m_vecAllProps
PP_PropertyVector m_vecAllAttribs

Private Attributes

XAP_Framem_pFrame
FV_Viewm_pView
PD_Documentm_pDoc
PT_DocPosition m_posBefore
PT_DocPosition m_posFocus
PT_DocPosition m_posAfter
PropMap m_mapCharProps
std::string m_ListProps [8]

Member Typedef Documentation

typedef std::map<std::string,std::string> AP_Dialog_Styles::PropMap

Member Enumeration Documentation

Enumerator:
a_OK 
a_CANCEL 

Constructor & Destructor Documentation

AP_Dialog_Styles::AP_Dialog_Styles ( XAP_DialogFactory pDlgFactory,
XAP_Dialog_Id  id 
)
AP_Dialog_Styles::~AP_Dialog_Styles ( void   )  [virtual]

Member Function Documentation

void AP_Dialog_Styles::_createAbiPreviewFromGC ( GR_Graphics gc,
UT_uint32  width,
UT_uint32  height 
) [protected]

This is the preview for the second dialog pane. It puts a complete mini-abiword in a graphics context so all the results of any style change is immediately obvious.

References DELETEP, getFrame(), m_pAbiPreview, PREVIEW_ZOOMED, and UT_return_if_fail.

Referenced by AP_Win32Dialog_Styles::_onInitDialog(), and AP_UnixDialog_Styles::modifyRunModal().

void AP_Dialog_Styles::_createParaPreviewFromGC ( GR_Graphics gc,
UT_uint32  width,
UT_uint32  height 
) [protected]
void AP_Dialog_Styles::_tabCallback ( const char *  szTabStops,
const char *  szDflTabStop 
)

Used for the Tabs dialog to extract info from the tabs dialog.

References m_vecAllProps, and PP_addOrSetAttribute().

Referenced by s_TabSaveCallBack().

bool AP_Dialog_Styles::applyModifiedStyleToDoc ( void   )  [protected]

Take the current style description and modify the description of the style in the main document.

References gchar, getCurrentStyle(), getDoc(), m_curStyleDesc, m_vecAllAttribs, m_vecAllProps, PP_makePropString(), PD_Document::setAllStyleAttributes(), and setDescription().

Referenced by AP_Win32Dialog_Styles::_onCommand(), and AP_UnixDialog_Styles::event_ModifyClicked().

bool AP_Dialog_Styles::createNewStyle ( const gchar *  szName  )  [protected]
void AP_Dialog_Styles::destroyAbiPreview ( void   )  [protected]

remove the mini-Abi preview in the second pane.

References DELETEP, and m_pAbiPreview.

Referenced by AP_Win32Dialog_Styles::_onCommand(), and AP_UnixDialog_Styles::modifyRunModal().

void AP_Dialog_Styles::drawLocal ( void   )  [protected]

This updates the mini-Abi in the second pane preview.

References AP_Preview_Abi::draw(), and m_pAbiPreview.

Referenced by AP_UnixDialog_Styles::event_ModifyPreviewExposed(), and updateCurrentStyle().

void AP_Dialog_Styles::event_charPreviewUpdated ( void   )  const [protected, virtual]
void AP_Dialog_Styles::event_paraPreviewUpdated ( const gchar *  pageLeftMargin,
const gchar *  pageRightMargin,
const gchar *  align,
const gchar *  firstLineIndent,
const gchar *  leftIndent,
const gchar *  rightIndent,
const gchar *  beforeSpacing,
const gchar *  afterSpacing,
const gchar *  lineSpacing 
) const [protected]
void AP_Dialog_Styles::fillVecFromCurrentPoint ( void   )  [protected]

This method extracts the properties defined at the current point in the active document and places them in a vectore where they can be easily displayed in previews and the display area.

References FV_View::getBlockFormat(), FV_View::getCharFormat(), getView(), m_vecAllProps, and szName.

Referenced by AP_Win32Dialog_Styles::_onInitDialog(), and AP_UnixDialog_Styles::_populateModify().

void AP_Dialog_Styles::fillVecWithProps ( const gchar *  szStyle,
bool  bReplaceAttributes = true 
) [protected]

This method takes a style and extracts all the properties associated with it and place them in a properties and attributes vector for easy modification by the code.

References gchar, PD_Style::getAttributeExpand(), getDoc(), PD_Style::getProperty(), m_vecAllAttribs, m_vecAllProps, PP_addOrSetAttribute(), PT_TYPE_ATTRIBUTE_NAME, szName, UT_DEBUGMSG, and xxx_UT_DEBUGMSG.

Referenced by AP_Win32Dialog_Styles::_onInitDialog(), AP_UnixDialog_Styles::_populateModify(), _populatePreviews(), and AP_Win32Dialog_Styles::eventBasedOn().

AP_Dialog_Styles::tAnswer AP_Dialog_Styles::getAnswer ( void   )  const

References m_answer.

virtual const char* AP_Dialog_Styles::getCurrentStyle ( void   )  const [protected, pure virtual]
PD_Document * AP_Dialog_Styles::getLDoc ( void   )  const [protected]

This is the pd_Document pointer for our mini-Abi in the second pane preview.

References AP_Preview_Abi::getDoc(), and m_pAbiPreview.

Referenced by _populateAbiPreview(), and updateCurrentStyle().

FV_View * AP_Dialog_Styles::getLView ( void   )  const [protected]

This is the FV_View pointer for our mini-abi in the second pane preview.

References AP_Preview_Abi::getView(), and m_pAbiPreview.

Referenced by _populateAbiPreview(), and updateCurrentStyle().

const gchar * AP_Dialog_Styles::getVecVal ( const UT_Vector v,
const gchar *  szProp 
) const [protected]

This method returns a pointer to the const char * value associated with the the attribute szProp. This version will extract properties from any vector with name:values set as: It assumes properties and values are stored the array like this: vecProp(n) : vecProp(n+1) "attribute" : "value"

References gchar, UT_GenericVector< T >::getItemCount(), and UT_GenericVector< T >::getNthItem().

Referenced by ModifyLists().

void AP_Dialog_Styles::ModifyFont ( void   )  [protected]

This method runs the tabs dialog to allow the user to edit the character properties of their style.

References gchar, XAP_Dialog_FontChooser::getAnswer(), XAP_Dialog_FontChooser::getChangedBGColor(), XAP_Dialog_FontChooser::getChangedBottomline(), XAP_Dialog_FontChooser::getChangedColor(), XAP_Dialog_FontChooser::getChangedFontFamily(), XAP_Dialog_FontChooser::getChangedFontSize(), XAP_Dialog_FontChooser::getChangedFontStyle(), XAP_Dialog_FontChooser::getChangedFontWeight(), XAP_Dialog_FontChooser::getChangedOverline(), XAP_Dialog_FontChooser::getChangedStrikeOut(), XAP_Dialog_FontChooser::getChangedTopline(), XAP_Dialog_FontChooser::getChangedUnderline(), fg_FillType::getColor(), FV_View::getCurrentPage(), XAP_Frame::getDialogFactory(), fp_Page::getFillType(), getFrame(), getView(), UT_RGBColor::m_blu, UT_RGBColor::m_grn, UT_RGBColor::m_red, m_vecAllProps, PP_addOrSetAttribute(), PP_getAttribute(), XAP_DialogFactory::releaseDialog(), XAP_DialogFactory::requestDialog(), XAP_Dialog_FontChooser::runModal(), XAP_Dialog_FontChooser::setBackGroundColor(), XAP_Dialog_FontChooser::setBGColor(), XAP_Dialog_FontChooser::setColor(), XAP_Dialog_FontChooser::setFontDecoration(), XAP_Dialog_FontChooser::setFontFamily(), XAP_Dialog_FontChooser::setFontSize(), XAP_Dialog_FontChooser::setFontStyle(), XAP_Dialog_FontChooser::setFontWeight(), XAP_Dialog_FontChooser::setGraphicsContext(), and UT_return_if_fail.

Referenced by AP_Win32Dialog_Styles::_onCommand(), and AP_UnixDialog_Styles::event_ModifyFont().

void AP_Dialog_Styles::ModifyTabs ( void   )  [protected]
virtual void AP_Dialog_Styles::runModal ( XAP_Frame pFrame  )  [pure virtual]

Implements XAP_Dialog_NonPersistent.

Implemented in AP_UnixDialog_Styles.

Referenced by s_doStylesDlg().

virtual void AP_Dialog_Styles::setDescription ( const char *  desc  )  const [protected, pure virtual]
void AP_Dialog_Styles::setDoc ( PD_Document pDoc  )  [protected]

Pointer to current the PD_Document for real document we're working with.

References m_pDoc.

Referenced by AP_Win32Dialog_Styles::runModal(), and AP_UnixDialog_Styles::runModal().

void AP_Dialog_Styles::setFrame ( XAP_Frame pFrame  )  [protected]

Pointer to the frame of the real document we're working with.

References m_pFrame.

Referenced by AP_Win32Dialog_Styles::runModal(), and AP_UnixDialog_Styles::runModal().

virtual void AP_Dialog_Styles::setModifyDescription ( const char *  desc  )  [protected, pure virtual]
void AP_Dialog_Styles::setView ( FV_View pView  )  [protected]

Pointer to the current FV_View of the document we're working with.

References m_pView.

Referenced by AP_Win32Dialog_Styles::runModal(), and AP_UnixDialog_Styles::runModal().


Member Data Documentation

std::string AP_Dialog_Styles::m_ListProps[8] [private]

Referenced by ModifyLists().

Referenced by getView(), and setView().


The documentation for this class was generated from the following files: