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