LCOV - code coverage report
Current view: top level - vcl/inc - salmenu.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 4 25.0 %
Date: 2012-08-25 Functions: 2 4 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _SV_SALMENU_HXX
      30                 :            : #define _SV_SALMENU_HXX
      31                 :            : 
      32                 :            : #include <tools/solar.h>
      33                 :            : #include "vcl/dllapi.h"
      34                 :            : #include <vcl/menu.hxx>
      35                 :            : #include <vcl/keycod.hxx>
      36                 :            : #include <vcl/image.hxx>
      37                 :            : 
      38                 :            : struct SystemMenuData;
      39                 :            : class FloatingWindow;
      40                 :            : class SalFrame;
      41                 :            : 
      42 [ +  - ][ +  - ]:     830750 : struct SalItemParams
      43                 :            : {
      44                 :            :     sal_uInt16          nId;                    // item Id
      45                 :            :     MenuItemType    eType;                  // MenuItem-Type
      46                 :            :     MenuItemBits    nBits;                  // MenuItem-Bits
      47                 :            :     Menu*           pMenu;                  // Pointer to Menu
      48                 :            :     rtl::OUString   aText;                  // Menu-Text
      49                 :            :     Image           aImage;                 // Image
      50                 :            : };
      51                 :            : 
      52                 :            : 
      53                 :          0 : struct SalMenuButtonItem
      54                 :            : {
      55                 :            :     sal_uInt16              mnId;
      56                 :            :     Image               maImage;
      57                 :            :     rtl::OUString       maToolTipText;
      58                 :            : 
      59                 :            :     SalMenuButtonItem() : mnId( 0 ) {}
      60                 :          0 :     SalMenuButtonItem( sal_uInt16 i_nId, const Image& rImg, const rtl::OUString& i_rTTText = rtl::OUString() )
      61                 :          0 :     : mnId( i_nId ), maImage( rImg ), maToolTipText( i_rTTText ) {}
      62                 :            : };
      63                 :            : 
      64                 :            : class VCL_PLUGIN_PUBLIC SalMenuItem
      65                 :            : {
      66                 :            : public:
      67                 :            :     SalMenuItem() {}
      68                 :            :     virtual ~SalMenuItem();
      69                 :            : };
      70                 :            : 
      71                 :            : class VCL_PLUGIN_PUBLIC SalMenu
      72                 :            : {
      73                 :            : public:
      74                 :            :     SalMenu() {}
      75                 :            :     virtual ~SalMenu();
      76                 :            : 
      77                 :            :     virtual sal_Bool VisibleMenuBar() = 0;  // must return sal_True to actually DISPLAY native menu bars
      78                 :            :                             // otherwise only menu messages are processed (eg, OLE on Windows)
      79                 :            : 
      80                 :            :     virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) = 0;
      81                 :            :     virtual void RemoveItem( unsigned nPos ) = 0;
      82                 :            :     virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) = 0;
      83                 :            :     virtual void SetFrame( const SalFrame* pFrame ) = 0;
      84                 :            :     virtual void CheckItem( unsigned nPos, sal_Bool bCheck ) = 0;
      85                 :            :     virtual void EnableItem( unsigned nPos, sal_Bool bEnable ) = 0;
      86                 :            :     virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText )= 0;
      87                 :            :     virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage ) = 0;
      88                 :            :     virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName ) = 0;
      89                 :            :     virtual void GetSystemMenuData( SystemMenuData* pData ) = 0;
      90                 :            :     virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags);
      91                 :            :     virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
      92                 :            :     virtual void RemoveMenuBarButton( sal_uInt16 nId );
      93                 :            : 
      94                 :            :     // return an empty rectangle if not implemented
      95                 :            :     // return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented
      96                 :            :     // but rectangle cannot be determined
      97                 :            :     virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame );
      98                 :            : };
      99                 :            : 
     100                 :            : 
     101                 :            : #endif // _SV_SALMENU_HXX
     102                 :            : 
     103                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10