LCOV - code coverage report
Current view: top level - libreoffice/vcl/inc - salmenu.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 5 20.0 %
Date: 2012-12-27 Functions: 2 5 40.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 _SV_SALMENU_HXX
      21             : #define _SV_SALMENU_HXX
      22             : 
      23             : #include <tools/solar.h>
      24             : #include "vcl/dllapi.h"
      25             : #include <vcl/menu.hxx>
      26             : #include <vcl/keycod.hxx>
      27             : #include <vcl/image.hxx>
      28             : 
      29             : struct SystemMenuData;
      30             : class FloatingWindow;
      31             : class SalFrame;
      32             : 
      33         112 : struct SalItemParams
      34             : {
      35             :     sal_uInt16      nId;                    // item Id
      36             :     MenuItemType    eType;                  // MenuItem-Type
      37             :     MenuItemBits    nBits;                  // MenuItem-Bits
      38             :     Menu*           pMenu;                  // Pointer to Menu
      39             :     rtl::OUString   aText;                  // Menu-Text
      40             :     Image           aImage;                 // Image
      41             : };
      42             : 
      43             : 
      44           0 : struct SalMenuButtonItem
      45             : {
      46             :     sal_uInt16          mnId;
      47             :     Image               maImage;
      48             :     rtl::OUString       maToolTipText;
      49             : 
      50             :     SalMenuButtonItem() : mnId( 0 ) {}
      51           0 :     SalMenuButtonItem( sal_uInt16 i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
      52           0 :     : mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
      53             : };
      54             : 
      55             : class VCL_PLUGIN_PUBLIC SalMenuItem
      56             : {
      57             : public:
      58             :     SalMenuItem() {}
      59             :     virtual ~SalMenuItem();
      60             : };
      61             : 
      62             : class VCL_PLUGIN_PUBLIC SalMenu
      63             : {
      64             : public:
      65             :     SalMenu() {}
      66             :     virtual ~SalMenu();
      67             : 
      68             :     virtual sal_Bool VisibleMenuBar() = 0;  // must return sal_True to actually DISPLAY native menu bars
      69             :                                             // otherwise only menu messages are processed (eg, OLE on Windows)
      70             : 
      71             :     virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) = 0;
      72             :     virtual void RemoveItem( unsigned nPos ) = 0;
      73             :     virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) = 0;
      74             :     virtual void SetFrame( const SalFrame* pFrame ) = 0;
      75             :     virtual void CheckItem( unsigned nPos, sal_Bool bCheck ) = 0;
      76             :     virtual void EnableItem( unsigned nPos, sal_Bool bEnable ) = 0;
      77             :     virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText )= 0;
      78             :     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
      79             :     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName ) = 0;
      80             :     virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
      81             :     virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
      82             :     virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
      83             :     virtual void RemoveMenuBarButton( sal_uInt16 nId );
      84             : 
      85             :     // TODO: implement show/hide for the Win/Mac VCL native backends
      86           0 :     virtual void ShowItem( unsigned nPos, sal_Bool bShow ) { EnableItem( nPos, bShow ); }
      87             : 
      88             :     // return an empty rectangle if not implemented
      89             :     // return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented
      90             :     // but rectangle cannot be determined
      91             :     virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
      92             : };
      93             : 
      94             : 
      95             : #endif // _SV_SALMENU_HXX
      96             : 
      97             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10