LibreOffice Module vcl (master) 1
win/salmenu.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_INC_WIN_SALMENU_H
21#define INCLUDED_VCL_INC_WIN_SALMENU_H
22
23#include <vcl/bitmap.hxx>
24#include <salmenu.hxx>
25
26class WinSalMenu : public SalMenu
27{
28public:
30 virtual ~WinSalMenu() override;
31 virtual bool HasNativeMenuBar() override;
32
33 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) override;
34 virtual void RemoveItem( unsigned nPos ) override;
35 virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) override;
36 virtual void SetFrame( const SalFrame* pFrame ) override;
37 virtual void CheckItem( unsigned nPos, bool bCheck ) override;
38 virtual void EnableItem( unsigned nPos, bool bEnable ) override;
39 virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override;
40 virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) override;
41 virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const vcl::KeyCode& rKeyCode, const OUString& rKeyName ) override;
42 virtual void GetSystemMenuData( SystemMenuData* pData ) override;
43
44 HMENU mhMenu; // the menu handle
45 bool mbMenuBar; // true for menu bars
46 HWND mhWnd; // the window handle where the menubar is attached, may be NULL
47 WinSalMenu *mpParentMenu; // the parent menu
48};
49
51{
52public:
54 virtual ~WinSalMenuItem() override;
55
56 MENUITEMINFOW mInfo;
57 void* mpMenu; // pointer to corresponding VCL menu
58 OUString mText; // the item text
59 OUString mAccelText; // the accelerator string
60 Bitmap maBitmap; // item image
61 int mnId; // item id
62 WinSalMenu* mpSalMenu; // the menu where this item is inserted
63};
64
65#endif // INCLUDED_VCL_INC_WIN_SALMENU_H
66
67/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: image.hxx:40
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual ~WinSalMenuItem() override
WinSalMenu * mpSalMenu
Definition: win/salmenu.h:62
MENUITEMINFOW mInfo
Definition: win/salmenu.h:56
OUString mAccelText
Definition: win/salmenu.h:59
OUString mText
Definition: win/salmenu.h:58
Bitmap maBitmap
Definition: win/salmenu.h:60
virtual void SetFrame(const SalFrame *pFrame) override
virtual void SetSubMenu(SalMenuItem *pSalMenuItem, SalMenu *pSubMenu, unsigned nPos) override
WinSalMenu * mpParentMenu
Definition: win/salmenu.h:47
virtual void SetItemImage(unsigned nPos, SalMenuItem *pSalMenuItem, const Image &rImage) override
HWND mhWnd
Definition: win/salmenu.h:46
HMENU mhMenu
Definition: win/salmenu.h:44
virtual ~WinSalMenu() override
virtual void RemoveItem(unsigned nPos) override
virtual bool HasNativeMenuBar() override
Return true, if the implementation supports a native menu bar (or wants to suppress LO's menu bar,...
virtual void InsertItem(SalMenuItem *pSalMenuItem, unsigned nPos) override
virtual void GetSystemMenuData(SystemMenuData *pData) override
virtual void SetAccelerator(unsigned nPos, SalMenuItem *pSalMenuItem, const vcl::KeyCode &rKeyCode, const OUString &rKeyName) override
virtual void CheckItem(unsigned nPos, bool bCheck) override
virtual void EnableItem(unsigned nPos, bool bEnable) override
virtual void SetItemText(unsigned nPos, SalMenuItem *pSalMenuItem, const OUString &rText) override
bool mbMenuBar
Definition: win/salmenu.h:45