LibreOffice Module vcl (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
GtkSalMenu Class Referencefinal

#include <gtksalmenu.hxx>

Inheritance diagram for GtkSalMenu:
[legend]
Collaboration diagram for GtkSalMenu:
[legend]

Public Member Functions

 GtkSalMenu (bool bMenuBar)
 
virtual ~GtkSalMenu () override
 
virtual bool VisibleMenuBar () override
 
virtual void InsertItem (SalMenuItem *pSalMenuItem, unsigned nPos) override
 
virtual void RemoveItem (unsigned nPos) override
 
virtual void SetSubMenu (SalMenuItem *pSalMenuItem, SalMenu *pSubMenu, unsigned nPos) override
 
virtual void SetFrame (const SalFrame *pFrame) override
 
const GtkSalFrameGetFrame () const
 
virtual void CheckItem (unsigned nPos, bool bCheck) override
 
virtual void EnableItem (unsigned nPos, bool bEnable) override
 
virtual void ShowItem (unsigned nPos, bool bShow) override
 
virtual void SetItemText (unsigned nPos, SalMenuItem *pSalMenuItem, const OUString &rText) override
 
virtual void SetItemImage (unsigned nPos, SalMenuItem *pSalMenuItem, const Image &rImage) override
 
virtual void SetAccelerator (unsigned nPos, SalMenuItem *pSalMenuItem, const vcl::KeyCode &rKeyCode, const OUString &rKeyName) override
 
virtual void GetSystemMenuData (SystemMenuData *pData) override
 
void SetMenu (Menu *pMenu)
 
MenuGetMenu ()
 
void SetMenuModel (GMenuModel *pMenuModel)
 
unsigned GetItemCount () const
 
GtkSalMenuItemGetItemAtPos (unsigned nPos)
 
void SetActionGroup (GActionGroup *pActionGroup)
 
bool IsItemVisible (unsigned nPos)
 
void NativeSetItemText (unsigned nSection, unsigned nItemPos, const OUString &rText)
 
void NativeSetItemIcon (unsigned nSection, unsigned nItemPos, const Image &rImage)
 
bool NativeSetItemCommand (unsigned nSection, unsigned nItemPos, sal_uInt16 nId, const gchar *aCommand, MenuItemBits nBits, bool bChecked, bool bIsSubmenu)
 
void NativeSetEnableItem (gchar const *aCommand, gboolean bEnable)
 
void NativeCheckItem (unsigned nSection, unsigned nItemPos, MenuItemBits bits, gboolean bCheck)
 
void NativeSetAccelerator (unsigned nSection, unsigned nItemPos, const vcl::KeyCode &rKeyCode, std::u16string_view rKeyName)
 
void EnableUnity (bool bEnable)
 
virtual void ShowMenuBar (bool bVisible) override
 
bool PrepUpdate () const
 
virtual void Update () override
 
void UpdateFull ()
 
void ClearActionGroupAndMenuModel ()
 
GtkSalMenuGetTopLevel ()
 
void SetNeedsUpdate ()
 
GtkWidgetGetMenuBarWidget () const
 
GtkWidgetGetMenuBarContainerWidget () const
 
void CreateMenuBarWidget ()
 
void DestroyMenuBarWidget ()
 
gboolean SignalKey (GdkEventKey const *pEvent)
 
void ReturnFocus ()
 
virtual bool ShowNativePopupMenu (FloatingWindow *pWin, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags) override
 
virtual void ShowCloseButton (bool bShow) override
 
virtual bool AddMenuBarButton (const SalMenuButtonItem &rNewItem) override
 
virtual void RemoveMenuBarButton (sal_uInt16 nId) override
 
virtual tools::Rectangle GetMenuBarButtonRectPixel (sal_uInt16 i_nItemId, SalFrame *i_pReferenceFrame) override
 
virtual bool CanGetFocus () const override
 
virtual bool TakeFocus () override
 
virtual int GetMenuBarHeight () const override
 
virtual void ApplyPersona () override
 
- Public Member Functions inherited from SalMenu
virtual ~SalMenu ()
 
virtual bool VisibleMenuBar ()=0
 
virtual void ShowMenuBar (bool)
 
virtual void InsertItem (SalMenuItem *pSalMenuItem, unsigned nPos)=0
 
virtual void RemoveItem (unsigned nPos)=0
 
virtual void SetSubMenu (SalMenuItem *pSalMenuItem, SalMenu *pSubMenu, unsigned nPos)=0
 
virtual void SetFrame (const SalFrame *pFrame)=0
 
virtual void SetItemBits (unsigned, MenuItemBits)
 
virtual void CheckItem (unsigned nPos, bool bCheck)=0
 
virtual void EnableItem (unsigned nPos, bool bEnable)=0
 
virtual void SetItemText (unsigned nPos, SalMenuItem *pSalMenuItem, const OUString &rText)=0
 
virtual void SetItemImage (unsigned nPos, SalMenuItem *pSalMenuItem, const Image &rImage)=0
 
virtual void SetAccelerator (unsigned nPos, SalMenuItem *pSalMenuItem, const vcl::KeyCode &rKeyCode, const OUString &rKeyName)=0
 
virtual void GetSystemMenuData (SystemMenuData *pData)=0
 
virtual bool ShowNativePopupMenu (FloatingWindow *pWin, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
 
virtual void ShowCloseButton (bool bShow)
 
virtual bool AddMenuBarButton (const SalMenuButtonItem &)
 
virtual void RemoveMenuBarButton (sal_uInt16 nId)
 
virtual void Update ()
 
virtual bool CanGetFocus () const
 
virtual bool TakeFocus ()
 
virtual void ShowItem (unsigned nPos, bool bShow)
 
virtual tools::Rectangle GetMenuBarButtonRectPixel (sal_uInt16 i_nItemId, SalFrame *i_pReferenceFrame)
 
virtual int GetMenuBarHeight () const
 
virtual void ApplyPersona ()
 

Static Public Member Functions

static void DispatchCommand (const gchar *pMenuCommand)
 
static void Activate (const gchar *pMenuCommand)
 
static void Deactivate (const gchar *pMenuCommand)
 

Private Member Functions

void ImplUpdate (bool bRecurse, bool bRemoveDisabledEntries)
 
void ActivateAllSubmenus (Menu *pMenuBar)
 
 DECL_LINK (MenuBarHierarchyChangeHandler, Timer *, void)
 

Static Private Member Functions

static GtkWidgetAddButton (GtkWidget *pImage)
 

Private Attributes

std::vector< GtkSalMenuItem * > maItems
 
std::vector< std::pair< sal_uInt16, GtkWidget * > > maExtraButtons
 
Idle maUpdateMenuBarIdle
 
bool mbInActivateCallback
 
bool mbMenuBar
 
bool mbNeedsUpdate
 
bool mbReturnFocusToDocument
 
bool mbAddedGrab
 
bool mbHasNullItemIcon = true
 Even setting null icon on a menuitem can be expensive, so cache state to avoid that call. More...
 
GtkWidgetmpMenuBarContainerWidget
 
std::unique_ptr< utl::TempFileNamedmxPersonaImage
 
BitmapEx maPersonaBitmap
 
GtkWidgetmpMenuAllowShrinkWidget
 
GtkWidgetmpMenuBarWidget
 
GtkWidgetmpMenuWidget
 
GtkCssProvider * mpMenuBarContainerProvider
 
GtkCssProvider * mpMenuBarProvider
 
GtkWidgetmpCloseButton
 
VclPtr< MenumpVCLMenu
 
GtkSalMenumpParentSalMenu
 
GtkSalFramempFrame
 
GMenuModel * mpMenuModel
 
GActionGroup * mpActionGroup
 

Detailed Description

Definition at line 32 of file gtksalmenu.hxx.

Constructor & Destructor Documentation

◆ GtkSalMenu()

GtkSalMenu::GtkSalMenu ( bool  bMenuBar)

◆ ~GtkSalMenu()

virtual GtkSalMenu::~GtkSalMenu ( )
overridevirtual

Member Function Documentation

◆ Activate()

static void GtkSalMenu::Activate ( const gchar *  pMenuCommand)
static

◆ ActivateAllSubmenus()

void GtkSalMenu::ActivateAllSubmenus ( Menu pMenuBar)
private

Referenced by UpdateFull().

◆ AddButton()

static GtkWidget * GtkSalMenu::AddButton ( GtkWidget pImage)
staticprivate

◆ AddMenuBarButton()

virtual bool GtkSalMenu::AddMenuBarButton ( const SalMenuButtonItem rNewItem)
overridevirtual

Reimplemented from SalMenu.

◆ ApplyPersona()

virtual void GtkSalMenu::ApplyPersona ( )
overridevirtual

Reimplemented from SalMenu.

◆ CanGetFocus()

virtual bool GtkSalMenu::CanGetFocus ( ) const
overridevirtual

Reimplemented from SalMenu.

◆ CheckItem()

virtual void GtkSalMenu::CheckItem ( unsigned  nPos,
bool  bCheck 
)
overridevirtual

Implements SalMenu.

◆ ClearActionGroupAndMenuModel()

void GtkSalMenu::ClearActionGroupAndMenuModel ( )

◆ CreateMenuBarWidget()

void GtkSalMenu::CreateMenuBarWidget ( )

◆ Deactivate()

static void GtkSalMenu::Deactivate ( const gchar *  pMenuCommand)
static

◆ DECL_LINK()

GtkSalMenu::DECL_LINK ( MenuBarHierarchyChangeHandler  ,
Timer ,
void   
)
private

◆ DestroyMenuBarWidget()

void GtkSalMenu::DestroyMenuBarWidget ( )

◆ DispatchCommand()

static void GtkSalMenu::DispatchCommand ( const gchar *  pMenuCommand)
static

◆ EnableItem()

virtual void GtkSalMenu::EnableItem ( unsigned  nPos,
bool  bEnable 
)
overridevirtual

Implements SalMenu.

◆ EnableUnity()

void GtkSalMenu::EnableUnity ( bool  bEnable)

◆ GetFrame()

const GtkSalFrame * GtkSalMenu::GetFrame ( ) const

◆ GetItemAtPos()

GtkSalMenuItem * GtkSalMenu::GetItemAtPos ( unsigned  nPos)
inline

Definition at line 94 of file gtksalmenu.hxx.

References maItems, and nPos.

◆ GetItemCount()

unsigned GtkSalMenu::GetItemCount ( ) const
inline

Definition at line 93 of file gtksalmenu.hxx.

References maItems.

◆ GetMenu()

Menu * GtkSalMenu::GetMenu ( )
inline

Definition at line 91 of file gtksalmenu.hxx.

References mpVCLMenu.

◆ GetMenuBarButtonRectPixel()

virtual tools::Rectangle GtkSalMenu::GetMenuBarButtonRectPixel ( sal_uInt16  i_nItemId,
SalFrame i_pReferenceFrame 
)
overridevirtual

Reimplemented from SalMenu.

◆ GetMenuBarContainerWidget()

GtkWidget * GtkSalMenu::GetMenuBarContainerWidget ( ) const
inline

Definition at line 126 of file gtksalmenu.hxx.

References mpMenuBarContainerWidget.

◆ GetMenuBarHeight()

virtual int GtkSalMenu::GetMenuBarHeight ( ) const
overridevirtual

Reimplemented from SalMenu.

◆ GetMenuBarWidget()

GtkWidget * GtkSalMenu::GetMenuBarWidget ( ) const
inline

Definition at line 125 of file gtksalmenu.hxx.

References mpMenuBarWidget.

◆ GetSystemMenuData()

virtual void GtkSalMenu::GetSystemMenuData ( SystemMenuData pData)
overridevirtual

Implements SalMenu.

◆ GetTopLevel()

GtkSalMenu * GtkSalMenu::GetTopLevel ( )

◆ ImplUpdate()

void GtkSalMenu::ImplUpdate ( bool  bRecurse,
bool  bRemoveDisabledEntries 
)
private

◆ InsertItem()

virtual void GtkSalMenu::InsertItem ( SalMenuItem pSalMenuItem,
unsigned  nPos 
)
overridevirtual

Implements SalMenu.

◆ IsItemVisible()

bool GtkSalMenu::IsItemVisible ( unsigned  nPos)

◆ NativeCheckItem()

void GtkSalMenu::NativeCheckItem ( unsigned  nSection,
unsigned  nItemPos,
MenuItemBits  bits,
gboolean  bCheck 
)

◆ NativeSetAccelerator()

void GtkSalMenu::NativeSetAccelerator ( unsigned  nSection,
unsigned  nItemPos,
const vcl::KeyCode rKeyCode,
std::u16string_view  rKeyName 
)

◆ NativeSetEnableItem()

void GtkSalMenu::NativeSetEnableItem ( gchar const *  aCommand,
gboolean  bEnable 
)

◆ NativeSetItemCommand()

bool GtkSalMenu::NativeSetItemCommand ( unsigned  nSection,
unsigned  nItemPos,
sal_uInt16  nId,
const gchar *  aCommand,
MenuItemBits  nBits,
bool  bChecked,
bool  bIsSubmenu 
)

◆ NativeSetItemIcon()

void GtkSalMenu::NativeSetItemIcon ( unsigned  nSection,
unsigned  nItemPos,
const Image rImage 
)

◆ NativeSetItemText()

void GtkSalMenu::NativeSetItemText ( unsigned  nSection,
unsigned  nItemPos,
const OUString &  rText 
)

◆ PrepUpdate()

bool GtkSalMenu::PrepUpdate ( ) const

◆ RemoveItem()

virtual void GtkSalMenu::RemoveItem ( unsigned  nPos)
overridevirtual

Implements SalMenu.

◆ RemoveMenuBarButton()

virtual void GtkSalMenu::RemoveMenuBarButton ( sal_uInt16  nId)
overridevirtual

Reimplemented from SalMenu.

◆ ReturnFocus()

void GtkSalMenu::ReturnFocus ( )

◆ SetAccelerator()

virtual void GtkSalMenu::SetAccelerator ( unsigned  nPos,
SalMenuItem pSalMenuItem,
const vcl::KeyCode rKeyCode,
const OUString &  rKeyName 
)
overridevirtual

Implements SalMenu.

◆ SetActionGroup()

void GtkSalMenu::SetActionGroup ( GActionGroup *  pActionGroup)
inline

Definition at line 95 of file gtksalmenu.hxx.

References mpActionGroup.

◆ SetFrame()

virtual void GtkSalMenu::SetFrame ( const SalFrame pFrame)
overridevirtual

Implements SalMenu.

◆ SetItemImage()

virtual void GtkSalMenu::SetItemImage ( unsigned  nPos,
SalMenuItem pSalMenuItem,
const Image rImage 
)
overridevirtual

Implements SalMenu.

◆ SetItemText()

virtual void GtkSalMenu::SetItemText ( unsigned  nPos,
SalMenuItem pSalMenuItem,
const OUString &  rText 
)
overridevirtual

Implements SalMenu.

◆ SetMenu()

void GtkSalMenu::SetMenu ( Menu pMenu)
inline

Definition at line 90 of file gtksalmenu.hxx.

References mpVCLMenu.

◆ SetMenuModel()

void GtkSalMenu::SetMenuModel ( GMenuModel *  pMenuModel)

◆ SetNeedsUpdate()

void GtkSalMenu::SetNeedsUpdate ( )

◆ SetSubMenu()

virtual void GtkSalMenu::SetSubMenu ( SalMenuItem pSalMenuItem,
SalMenu pSubMenu,
unsigned  nPos 
)
overridevirtual

Implements SalMenu.

◆ ShowCloseButton()

virtual void GtkSalMenu::ShowCloseButton ( bool  bShow)
overridevirtual

Reimplemented from SalMenu.

◆ ShowItem()

virtual void GtkSalMenu::ShowItem ( unsigned  nPos,
bool  bShow 
)
overridevirtual

Reimplemented from SalMenu.

◆ ShowMenuBar()

virtual void GtkSalMenu::ShowMenuBar ( bool  bVisible)
overridevirtual

Reimplemented from SalMenu.

◆ ShowNativePopupMenu()

virtual bool GtkSalMenu::ShowNativePopupMenu ( FloatingWindow pWin,
const tools::Rectangle rRect,
FloatWinPopupFlags  nFlags 
)
overridevirtual

Reimplemented from SalMenu.

◆ SignalKey()

gboolean GtkSalMenu::SignalKey ( GdkEventKey const *  pEvent)

◆ TakeFocus()

virtual bool GtkSalMenu::TakeFocus ( )
overridevirtual

Reimplemented from SalMenu.

◆ Update()

virtual void GtkSalMenu::Update ( )
overridevirtual

Reimplemented from SalMenu.

◆ UpdateFull()

void GtkSalMenu::UpdateFull ( )
inline

Definition at line 119 of file gtksalmenu.hxx.

References ActivateAllSubmenus(), and mpVCLMenu.

◆ VisibleMenuBar()

virtual bool GtkSalMenu::VisibleMenuBar ( )
overridevirtual

Implements SalMenu.

Member Data Documentation

◆ maExtraButtons

std::vector<std::pair<sal_uInt16, GtkWidget*> > GtkSalMenu::maExtraButtons
private

Definition at line 36 of file gtksalmenu.hxx.

◆ maItems

std::vector< GtkSalMenuItem* > GtkSalMenu::maItems
private

Definition at line 35 of file gtksalmenu.hxx.

Referenced by GetItemAtPos(), and GetItemCount().

◆ maPersonaBitmap

BitmapEx GtkSalMenu::maPersonaBitmap
private

Definition at line 48 of file gtksalmenu.hxx.

◆ maUpdateMenuBarIdle

Idle GtkSalMenu::maUpdateMenuBarIdle
private

Definition at line 37 of file gtksalmenu.hxx.

◆ mbAddedGrab

bool GtkSalMenu::mbAddedGrab
private

Definition at line 43 of file gtksalmenu.hxx.

◆ mbHasNullItemIcon

bool GtkSalMenu::mbHasNullItemIcon = true
private

Even setting null icon on a menuitem can be expensive, so cache state to avoid that call.

Definition at line 45 of file gtksalmenu.hxx.

◆ mbInActivateCallback

bool GtkSalMenu::mbInActivateCallback
private

Definition at line 39 of file gtksalmenu.hxx.

◆ mbMenuBar

bool GtkSalMenu::mbMenuBar
private

Definition at line 40 of file gtksalmenu.hxx.

◆ mbNeedsUpdate

bool GtkSalMenu::mbNeedsUpdate
private

Definition at line 41 of file gtksalmenu.hxx.

◆ mbReturnFocusToDocument

bool GtkSalMenu::mbReturnFocusToDocument
private

Definition at line 42 of file gtksalmenu.hxx.

◆ mpActionGroup

GActionGroup* GtkSalMenu::mpActionGroup
private

Definition at line 61 of file gtksalmenu.hxx.

Referenced by SetActionGroup().

◆ mpCloseButton

GtkWidget* GtkSalMenu::mpCloseButton
private

Definition at line 54 of file gtksalmenu.hxx.

◆ mpFrame

GtkSalFrame* GtkSalMenu::mpFrame
private

Definition at line 57 of file gtksalmenu.hxx.

◆ mpMenuAllowShrinkWidget

GtkWidget* GtkSalMenu::mpMenuAllowShrinkWidget
private

Definition at line 49 of file gtksalmenu.hxx.

◆ mpMenuBarContainerProvider

GtkCssProvider* GtkSalMenu::mpMenuBarContainerProvider
private

Definition at line 52 of file gtksalmenu.hxx.

◆ mpMenuBarContainerWidget

GtkWidget* GtkSalMenu::mpMenuBarContainerWidget
private

Definition at line 46 of file gtksalmenu.hxx.

Referenced by GetMenuBarContainerWidget().

◆ mpMenuBarProvider

GtkCssProvider* GtkSalMenu::mpMenuBarProvider
private

Definition at line 53 of file gtksalmenu.hxx.

◆ mpMenuBarWidget

GtkWidget* GtkSalMenu::mpMenuBarWidget
private

Definition at line 50 of file gtksalmenu.hxx.

Referenced by GetMenuBarWidget().

◆ mpMenuModel

GMenuModel* GtkSalMenu::mpMenuModel
private

Definition at line 60 of file gtksalmenu.hxx.

◆ mpMenuWidget

GtkWidget* GtkSalMenu::mpMenuWidget
private

Definition at line 51 of file gtksalmenu.hxx.

◆ mpParentSalMenu

GtkSalMenu* GtkSalMenu::mpParentSalMenu
private

Definition at line 56 of file gtksalmenu.hxx.

◆ mpVCLMenu

VclPtr<Menu> GtkSalMenu::mpVCLMenu
private

Definition at line 55 of file gtksalmenu.hxx.

Referenced by GetMenu(), SetMenu(), and UpdateFull().

◆ mxPersonaImage

std::unique_ptr<utl::TempFileNamed> GtkSalMenu::mxPersonaImage
private

Definition at line 47 of file gtksalmenu.hxx.


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