#include <ev_Win32Toolbar.h>
Public Member Functions | |
EV_Win32Toolbar (XAP_Win32App *pWin32App, XAP_Frame *pFrame, const char *szToolbarLayoutName, const char *szToolbarLabelSetName) | |
virtual | ~EV_Win32Toolbar (void) |
bool | toolbarEvent (XAP_Toolbar_Id id, UT_UCSChar *pData=0, UT_uint32 dataLength=0) |
virtual bool | synthesize (void) |
bool | bindListenerToView (AV_View *pView) |
virtual bool | refreshToolbar (AV_View *pView, AV_ChangeMask mask) |
virtual bool | repopulateStyles (void) |
bool | getToolTip (LPARAM lParam) |
HWND | getWindow (void) const |
XAP_Frame * | getFrame (void) |
void | onDropArrow (UINT cmd) |
XAP_Toolbar_Id | ItemIdFromWmCommand (UINT cmd) |
UINT | WmCommandFromItemId (XAP_Toolbar_Id id) |
bool | bVisible (void) |
Protected Member Functions | |
virtual void | show (void) |
virtual void | hide (void) |
void | _releaseListener (void) |
HWND | _getControlWindow (XAP_Toolbar_Id id) |
bool | _refreshID (XAP_Toolbar_Id id) |
bool | _refreshItem (AV_View *pView, const EV_Toolbar_Action *pAction, XAP_Toolbar_Id id) |
Private Member Functions | |
int | _getBandForHwnd (HWND hToolbar) const |
void | _addToRebar () |
Static Private Member Functions | |
static LRESULT CALLBACK | _ComboWndProc (HWND, UINT, WPARAM, LPARAM) |
static LRESULT CALLBACK | _ComboEditWndProc (HWND, UINT, WPARAM, LPARAM) |
static LRESULT CALLBACK | _ToolBarWndProc (HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam) |
Private Attributes | |
XAP_Win32App * | m_pWin32App |
XAP_Frame * | m_pWin32Frame |
EV_Win32Toolbar_ViewListener * | m_pViewListener |
AV_ListenerId | m_lid |
HWND | m_hwnd |
UT_Vector | m_vecToolbarWidgets |
AP_Win32Toolbar_FontCombo * | m_pFontCtrl |
bool | m_bVisible |
UT_GenericVector< UT_UTF8String * > | m_vecOrgStylesNames |
EV_Win32Toolbar::EV_Win32Toolbar | ( | XAP_Win32App * | pWin32App, | |
XAP_Frame * | pFrame, | |||
const char * | szToolbarLayoutName, | |||
const char * | szToolbarLabelSetName | |||
) |
EV_Win32Toolbar::~EV_Win32Toolbar | ( | void | ) | [virtual] |
void EV_Win32Toolbar::_addToRebar | ( | ) | [private] |
References XAP_Frame::getFrameImpl(), m_hwnd, and m_pWin32Frame.
Referenced by show(), and synthesize().
static LRESULT CALLBACK EV_Win32Toolbar::_ComboEditWndProc | ( | HWND | , | |
UINT | , | |||
WPARAM | , | |||
LPARAM | ||||
) | [static, private] |
LRESULT CALLBACK EV_Win32Toolbar::_ComboWndProc | ( | HWND | hWnd, | |
UINT | uMessage, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [static, private] |
References _refreshID(), UT_Win32LocaleString::c_str(), COMBO_BUF_LEN, DELETEP, UT_Win32LocaleString::fromLocale(), UT_Win32LocaleString::fromUTF8(), EV_Toolbar_Control::getContents(), XAP_Toolbar_ControlFactory::getControl(), XAP_Win32App::getControlFactory(), XAP_Frame::getFrameImpl(), UT_GenericVector< T >::getNthItem(), ItemIdFromWmCommand(), UT_UTF8String::length(), m_pFontCtrl, m_pWin32App, m_pWin32Frame, m_vecOrgStylesNames, AP_Win32Toolbar_FontCombo::populate(), AP_Win32Toolbar_StyleCombo::repopulate(), s_lpfnDefCombo, UT_UCS2String::size(), size, toolbarEvent(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_UCS4_strcpy_utf8_char(), UT_UCS4_strlen(), UT_UTF8String::utf8_str(), UT_Win32LocaleString::utf8_str(), and v.
Referenced by synthesize().
int EV_Win32Toolbar::_getBandForHwnd | ( | HWND | hToolbar | ) | const [private] |
References XAP_Frame::getFrameImpl(), and m_pWin32Frame.
HWND EV_Win32Toolbar::_getControlWindow | ( | XAP_Toolbar_Id | id | ) | [protected] |
References m_hwnd, UT_ASSERT, and WmCommandFromItemId().
Referenced by _refreshItem(), repopulateStyles(), and synthesize().
bool EV_Win32Toolbar::_refreshID | ( | XAP_Toolbar_Id | id | ) | [protected] |
References _refreshItem(), EV_Toolbar_ActionSet::getAction(), XAP_Frame::getCurrentView(), XAP_App::getToolbarActionSet(), m_pWin32App, m_pWin32Frame, UT_ASSERT, and UT_return_val_if_fail.
Referenced by _ComboWndProc().
bool EV_Win32Toolbar::_refreshItem | ( | AV_View * | pView, | |
const EV_Toolbar_Action * | pAction, | |||
XAP_Toolbar_Id | id | |||
) | [protected] |
References _getControlWindow(), UT_Win32LocaleString::c_str(), EV_TBIT_BOGUS, EV_TBIT_ColorBack, EV_TBIT_ColorFore, EV_TBIT_ComboBox, EV_TBIT_DropDown, EV_TBIT_EditText, EV_TBIT_GroupButton, EV_TBIT_PushButton, EV_TBIT_Spacer, EV_TBIT_StaticLabel, EV_TBIT_ToggleButton, EV_TIS_ShouldBeGray, EV_TIS_ShouldBeToggled, UT_Win32LocaleString::fromUTF8(), XAP_App::getApp(), EV_Toolbar_Action::getItemType(), XAP_App::getStringSet(), EV_Toolbar_Action::getToolbarItemState(), XAP_StringSet::getValue(), m_hwnd, pt_PieceTable::s_getLocalisedStyleName(), UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, and WmCommandFromItemId().
Referenced by _refreshID(), and refreshToolbar().
void EV_Win32Toolbar::_releaseListener | ( | void | ) | [protected] |
References DELETEP, m_lid, and m_pViewListener.
Referenced by bindListenerToView(), and ~EV_Win32Toolbar().
LRESULT CALLBACK EV_Win32Toolbar::_ToolBarWndProc | ( | HWND | hWnd, | |
UINT | uMessage, | |||
WPARAM | wParam, | |||
LPARAM | lParam | |||
) | [static, private] |
References s_lpfnDefToolBar, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.
Referenced by synthesize().
bool EV_Win32Toolbar::bindListenerToView | ( | AV_View * | pView | ) |
References _releaseListener(), AV_View::addListener(), AV_CHG_ALL, AV_View::isDocumentPresent(), m_hwnd, m_lid, m_pViewListener, refreshToolbar(), and UT_ASSERT.
Referenced by AP_Win32FrameImpl::_bindToolbars().
bool EV_Win32Toolbar::bVisible | ( | void | ) | [inline] |
Referenced by AP_Win32FrameImpl::_toggleBar().
XAP_Frame * EV_Win32Toolbar::getFrame | ( | void | ) |
References m_pWin32Frame.
bool EV_Win32Toolbar::getToolTip | ( | LPARAM | lParam | ) |
References UT_Win32LocaleString::c_str(), UT_Win32LocaleString::fromUTF8(), EV_Toolbar_LabelSet::getLabel(), EV_Toolbar_Label::getStatusMsg(), EV_Toolbar_Label::getToolbarLabel(), EV_Toolbar_Label::getToolTip(), ItemIdFromWmCommand(), EV_Toolbar::m_pToolbarLabelSet, and UT_ASSERT.
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
HWND EV_Win32Toolbar::getWindow | ( | void | ) | const |
References m_hwnd.
Referenced by XAP_Win32FrameImpl::_FrameWndProc(), and XAP_Win32FrameImpl::_newToolbar().
void EV_Win32Toolbar::hide | ( | void | ) | [protected, virtual] |
Reimplemented from EV_Toolbar.
References _getBandForHwnd(), XAP_Frame::getFrameImpl(), m_bVisible, m_hwnd, m_pWin32Frame, UT_ASSERT, and UT_return_if_fail.
XAP_Toolbar_Id EV_Win32Toolbar::ItemIdFromWmCommand | ( | UINT | cmd | ) | [inline] |
Referenced by _ComboWndProc(), XAP_Win32FrameImpl::_FrameWndProc(), getToolTip(), and onDropArrow().
void EV_Win32Toolbar::onDropArrow | ( | UINT | cmd | ) |
References AP_DIALOG_ID_BACKGROUND, UT_UTF8String::empty(), EV_Toolbar_ActionSet::getAction(), AP_Dialog_Background::getAnswer(), AP_Dialog_Background::getColor(), XAP_Frame::getCurrentView(), XAP_Frame::getDialogFactory(), XAP_Frame::getFrameImpl(), EV_Toolbar_Action::getItemType(), AV_View::getParentData(), XAP_App::getToolbarActionSet(), ItemIdFromWmCommand(), m_pWin32App, m_pWin32Frame, XAP_Win32FrameImpl::m_sColorBack, XAP_Win32FrameImpl::m_sColorFore, XAP_Frame::raise(), XAP_DialogFactory::releaseDialog(), XAP_DialogFactory::requestDialog(), AP_Dialog_Background::runModal(), AP_Dialog_Background::setColor(), toolbarEvent(), UT_ASSERT_HARMLESS, UT_return_if_fail, and UT_UTF8String::utf8_str().
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
bool EV_Win32Toolbar::refreshToolbar | ( | AV_View * | pView, | |
AV_ChangeMask | mask | |||
) | [virtual] |
References _refreshItem(), EV_TLF_Normal, EV_TLF_Spacer, EV_Toolbar_ActionSet::getAction(), EV_Toolbar_Action::getChangeMaskOfInterest(), EV_Toolbar_Layout::getLayoutItem(), EV_Toolbar_Layout::getLayoutItemCount(), XAP_App::getToolbarActionSet(), EV_Toolbar_LayoutItem::getToolbarId(), EV_Toolbar_LayoutItem::getToolbarLayoutFlags(), m_hwnd, EV_Toolbar::m_pToolbarLayout, m_pWin32App, UT_ASSERT, UT_ASSERT_HARMLESS, and UT_continue_if_fail.
Referenced by bindListenerToView(), and EV_Win32Toolbar_ViewListener::notify().
bool EV_Win32Toolbar::repopulateStyles | ( | void | ) | [virtual] |
This method examines the current document and repopulates the Styles Combo box with what is in the document. It returns false if no styles combo box was found. True if it all worked.
Reimplemented from EV_Toolbar.
References _getControlWindow(), UT_GenericVector< T >::addItem(), UT_Win32LocaleString::c_str(), UT_GenericVector< T >::clear(), UT_Win32LocaleString::fromUTF8(), EV_Toolbar_Control::getContents(), XAP_Toolbar_ControlFactory::getControl(), XAP_Win32App::getControlFactory(), AP_Win32Toolbar_StyleCombo::getDroppedWidth(), UT_GenericVector< T >::getItemCount(), EV_Toolbar_Layout::getLayoutItem(), EV_Toolbar_Layout::getLayoutItemCount(), UT_GenericVector< T >::getNthItem(), EV_Toolbar_LayoutItem::getToolbarId(), id, EV_Toolbar::m_pToolbarLayout, m_pWin32App, m_vecOrgStylesNames, AP_Win32Toolbar_StyleCombo::repopulate(), pt_PieceTable::s_getLocalisedStyleName(), UT_ASSERT, UT_return_val_if_fail, and v.
void EV_Win32Toolbar::show | ( | void | ) | [protected, virtual] |
Reimplemented from EV_Toolbar.
References _addToRebar(), _getBandForHwnd(), XAP_Frame::getFrameImpl(), m_bVisible, m_hwnd, m_pWin32Frame, UT_ASSERT, and UT_return_if_fail.
bool EV_Win32Toolbar::synthesize | ( | void | ) | [virtual] |
Reimplemented from EV_Toolbar.
References _addToRebar(), _ComboWndProc(), _getControlWindow(), _ToolBarWndProc(), UT_Win32LocaleString::c_str(), DELETEP, EV_TBIT_BOGUS, EV_TBIT_ColorBack, EV_TBIT_ColorFore, EV_TBIT_ComboBox, EV_TBIT_DropDown, EV_TBIT_EditText, EV_TBIT_GroupButton, EV_TBIT_PushButton, EV_TBIT_Spacer, EV_TBIT_StaticLabel, EV_TBIT_ToggleButton, EV_TLF_Normal, EV_TLF_Spacer, UT_Win32LocaleString::fromUTF8(), gchar, EV_Toolbar_ActionSet::getAction(), XAP_Win32Toolbar_Icons::getBitmapForIcon(), EV_Toolbar_Control::getContents(), XAP_Toolbar_ControlFactory::getControl(), XAP_Win32App::getControlFactory(), EV_Toolbar_Control::getDroppedWidth(), XAP_Frame::getFrameImpl(), EV_Toolbar_Label::getIconName(), XAP_Win32App::getInstance(), UT_GenericVector< T >::getItemCount(), EV_Toolbar_Action::getItemType(), EV_Toolbar_LabelSet::getLabel(), EV_Toolbar_Layout::getLayoutItem(), EV_Toolbar_Layout::getLayoutItemCount(), UT_GenericVector< T >::getNthItem(), EV_Toolbar_Control::getPixelWidth(), XAP_App::getPrefsValue(), EV_Toolbar_Label::getStatusMsg(), XAP_App::getToolbarActionSet(), EV_Toolbar_LayoutItem::getToolbarId(), EV_Toolbar_Label::getToolbarLabel(), EV_Toolbar_LayoutItem::getToolbarLayoutFlags(), EV_Toolbar_Label::getToolTip(), instance, m_bVisible, m_hwnd, EV_Toolbar::m_pToolbarLabelSet, EV_Toolbar::m_pToolbarLayout, m_pWin32App, m_pWin32Frame, EV_Toolbar_Control::populate(), s_lpfnDefCombo, s_lpfnDefToolBar, EV_Toolbar_Control::shouldSort(), TB_GETEXTENDEDSTYLE, TB_SETEXTENDEDSTYLE, UT_ASSERT, UT_ASSERT_HARMLESS, UT_continue_if_fail, UT_CreateWindowEx(), UT_DEBUGMSG, UT_return_val_if_fail, v, WmCommandFromItemId(), and XAP_PREF_KEY_ToolbarAppearance.
bool EV_Win32Toolbar::toolbarEvent | ( | XAP_Toolbar_Id | id, | |
UT_UCSChar * | pData = 0 , |
|||
UT_uint32 | dataLength = 0 | |||
) |
References EV_TBIT_ColorFore, EV_TIS_ShouldBeToggled, EV_EditMethodContainer::findEditMethodByName(), EV_Toolbar_ActionSet::getAction(), XAP_Frame::getCurrentView(), XAP_App::getEditMethodContainer(), XAP_Frame::getFrameImpl(), EV_Toolbar_Action::getItemType(), EV_Toolbar_Action::getMethodName(), XAP_App::getToolbarActionSet(), EV_Toolbar_Action::getToolbarItemState(), EV_Toolbar::invokeToolbarMethod(), m_pWin32App, m_pWin32Frame, XAP_Win32FrameImpl::m_sColorBack, XAP_Win32FrameImpl::m_sColorFore, UT_UTF8String::size(), UT_UCS4String::ucs4_str(), UT_UTF8String::ucs4_str(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_TODO.
Referenced by _ComboWndProc(), XAP_Win32FrameImpl::_FrameWndProc(), and onDropArrow().
UINT EV_Win32Toolbar::WmCommandFromItemId | ( | XAP_Toolbar_Id | id | ) | [inline] |
References _ev_MENU_OFFSET.
Referenced by _getControlWindow(), _refreshItem(), and synthesize().
bool EV_Win32Toolbar::m_bVisible [private] |
Referenced by hide(), show(), and synthesize().
HWND EV_Win32Toolbar::m_hwnd [private] |
Referenced by _addToRebar(), _getControlWindow(), _refreshItem(), bindListenerToView(), getWindow(), hide(), refreshToolbar(), show(), and synthesize().
AV_ListenerId EV_Win32Toolbar::m_lid [private] |
Referenced by _releaseListener(), and bindListenerToView().
Referenced by _ComboWndProc(), and ~EV_Win32Toolbar().
Referenced by _releaseListener(), and bindListenerToView().
XAP_Win32App* EV_Win32Toolbar::m_pWin32App [private] |
Referenced by _ComboWndProc(), _refreshID(), onDropArrow(), refreshToolbar(), repopulateStyles(), synthesize(), and toolbarEvent().
XAP_Frame* EV_Win32Toolbar::m_pWin32Frame [private] |
Referenced by _addToRebar(), _ComboWndProc(), _getBandForHwnd(), _refreshID(), getFrame(), hide(), onDropArrow(), show(), synthesize(), and toolbarEvent().
Referenced by _ComboWndProc(), repopulateStyles(), and ~EV_Win32Toolbar().