xref: /aoo41x/main/vcl/inc/win/salmenu.h (revision 79aad27f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALMENU_H
25 #define _SV_SALMENU_H
26 
27 #include <vcl/bitmap.hxx>
28 #include <salmenu.hxx>
29 
30 class WinSalMenu : public SalMenu
31 {
32 public:
33     WinSalMenu();
34     virtual ~WinSalMenu();
35     virtual sal_Bool VisibleMenuBar();  // must return TRUE to actually DISPLAY native menu bars
36                             // otherwise only menu messages are processed (eg, OLE on Windows)
37 
38     virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
39     virtual void RemoveItem( unsigned nPos );
40     virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
41     virtual void SetFrame( const SalFrame* pFrame );
42     virtual void CheckItem( unsigned nPos, sal_Bool bCheck );
43     virtual void EnableItem( unsigned nPos, sal_Bool bEnable );
44     virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
45     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage );
46     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
47     virtual void GetSystemMenuData( SystemMenuData* pData );
48 
49     HMENU mhMenu;           // the menu handle
50     sal_Bool  mbMenuBar;        // true for menu bars
51     HWND  mhWnd;            // the window handle where the menubar is attached, may be NULL
52     WinSalMenu *mpParentMenu;  // the parent menu
53 };
54 
55 class WinSalMenuItem : public SalMenuItem
56 {
57 public:
58     WinSalMenuItem();
59     virtual ~WinSalMenuItem();
60 
61 
62     MENUITEMINFOW mInfo;
63     void*     mpMenu;       // pointer to corresponding VCL menu
64     XubString mText;        // the item text
65     XubString mAccelText;   // the accelerator string
66     Bitmap    maBitmap;     // item image
67     int       mnId;         // item id
68     WinSalMenu*  mpSalMenu;    // the menu where this item is inserted
69 };
70 
71 #endif // _SV_SALMENU_H
72 
73