LCOV - code coverage report
Current view: top level - include/vcl - status.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 5 5 100.0 %
Date: 2014-04-11 Functions: 5 5 100.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 INCLUDED_VCL_STATUS_HXX
      21             : #define INCLUDED_VCL_STATUS_HXX
      22             : 
      23             : #include <tools/solar.h>
      24             : #include <vcl/dllapi.h>
      25             : #include <vcl/window.hxx>
      26             : #include <vector>
      27             : 
      28             : struct ImplStatusItem;
      29             : typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
      30             : 
      31             : 
      32             : // - Progress-Ausgabe -
      33             : 
      34             : 
      35             : void VCL_DLLPUBLIC DrawProgress( Window* pWindow, const Point& rPos,
      36             :                                  long nOffset, long nPrgsWidth, long nPrgsHeight,
      37             :                                  sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount,
      38             :                                  const Rectangle& rFramePosSize
      39             :                                  );
      40             : 
      41             : 
      42             : // - StatusBarItemBits -
      43             : 
      44             : 
      45             : typedef sal_uInt16 StatusBarItemBits;
      46             : 
      47             : 
      48             : // - Bits fuer StatusBarItems -
      49             : 
      50             : 
      51             : #define SIB_LEFT                    ((StatusBarItemBits)0x0001)
      52             : #define SIB_CENTER                  ((StatusBarItemBits)0x0002)
      53             : #define SIB_RIGHT                   ((StatusBarItemBits)0x0004)
      54             : #define SIB_IN                      ((StatusBarItemBits)0x0008)
      55             : #define SIB_OUT                     ((StatusBarItemBits)0x0010)
      56             : #define SIB_FLAT                    ((StatusBarItemBits)0x0020)
      57             : #define SIB_AUTOSIZE                ((StatusBarItemBits)0x0040)
      58             : #define SIB_USERDRAW                ((StatusBarItemBits)0x0080)
      59             : 
      60             : 
      61             : // - StatusBar-Types -
      62             : 
      63             : 
      64             : #define STATUSBAR_APPEND            ((sal_uInt16)0xFFFF)
      65             : #define STATUSBAR_ITEM_NOTFOUND     ((sal_uInt16)0xFFFF)
      66             : #define STATUSBAR_OFFSET            ((long)5)
      67             : 
      68             : 
      69             : // - StatusBar -
      70             : 
      71             : 
      72             : class VCL_DLLPUBLIC StatusBar : public Window
      73             : {
      74             :     class   ImplData;
      75             : private:
      76             :     ImplStatusItemList* mpItemList;
      77             :     ImplData*           mpImplData;
      78             :     OUString            maPrgsTxt;
      79             :     Point               maPrgsTxtPos;
      80             :     Rectangle           maPrgsFrameRect;
      81             :     long                mnPrgsSize;
      82             :     long                mnItemsWidth;
      83             :     long                mnDX;
      84             :     long                mnDY;
      85             :     long                mnCalcHeight;
      86             :     long                mnTextY;
      87             :     long                mnItemY;
      88             :     sal_uInt16              mnCurItemId;
      89             :     sal_uInt16              mnPercent;
      90             :     sal_uInt16              mnPercentCount;
      91             :     bool                mbVisibleItems;
      92             :     bool                mbFormat;
      93             :     bool                mbProgressMode;
      94             :     bool                mbInUserDraw;
      95             :     Link                maClickHdl;
      96             :     Link                maDoubleClickHdl;
      97             : 
      98             :     using Window::ImplInit;
      99             :     SAL_DLLPRIVATE void      ImplInit( Window* pParent, WinBits nStyle );
     100             :     SAL_DLLPRIVATE void      ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
     101             :     SAL_DLLPRIVATE void      ImplFormat();
     102             :     SAL_DLLPRIVATE bool      ImplIsItemUpdate();
     103             :     using OutputDevice::ImplDrawText;
     104             :     SAL_DLLPRIVATE void      ImplDrawText( bool bOffScreen, long nOldTextWidth );
     105             :     SAL_DLLPRIVATE void      ImplDrawItem( bool bOffScreen, sal_uInt16 nPos, bool bDrawText, bool bDrawFrame );
     106             :     SAL_DLLPRIVATE void      ImplDrawProgress( bool bPaint,
     107             :                                                sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
     108             :     SAL_DLLPRIVATE void      ImplCalcProgressRect();
     109             :     SAL_DLLPRIVATE Rectangle ImplGetItemRectPos( sal_uInt16 nPos ) const;
     110             :     SAL_DLLPRIVATE sal_uInt16    ImplGetFirstVisiblePos() const;
     111             : 
     112             : public:
     113             :                         StatusBar( Window* pParent,
     114             :                                    WinBits nWinStyle = WB_BORDER | WB_RIGHT );
     115             :                         virtual ~StatusBar();
     116             : 
     117             :     virtual void        MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
     118             :     virtual void        Paint( const Rectangle& rRect ) SAL_OVERRIDE;
     119             :     virtual void        Move() SAL_OVERRIDE;
     120             :     virtual void        Resize() SAL_OVERRIDE;
     121             :     virtual void        RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
     122             :     virtual void        StateChanged( StateChangedType nType ) SAL_OVERRIDE;
     123             :     virtual void        DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
     124             : 
     125             :     virtual void        Click();
     126             :     virtual void        DoubleClick();
     127             :     virtual void        UserDraw( const UserDrawEvent& rUDEvt );
     128             : 
     129             :     void                InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
     130             :                                     StatusBarItemBits nBits = SIB_CENTER | SIB_IN,
     131             :                                     long nOffset = STATUSBAR_OFFSET,
     132             :                                     sal_uInt16 nPos = STATUSBAR_APPEND );
     133             :     void                RemoveItem( sal_uInt16 nItemId );
     134             : 
     135             :     void                ShowItem( sal_uInt16 nItemId );
     136             :     void                HideItem( sal_uInt16 nItemId );
     137             :     bool                IsItemVisible( sal_uInt16 nItemId ) const;
     138             : 
     139       14386 :     bool                AreItemsVisible() const { return mbVisibleItems; }
     140             : 
     141             :     void                RedrawItem( sal_uInt16 nItemId );
     142             : 
     143             :     void                Clear();
     144             : 
     145             :     sal_uInt16              GetItemCount() const;
     146             :     sal_uInt16              GetItemId( sal_uInt16 nPos ) const;
     147             :     sal_uInt16              GetItemId( const Point& rPos ) const;
     148             :     sal_uInt16              GetItemPos( sal_uInt16 nItemId ) const;
     149             :     Rectangle           GetItemRect( sal_uInt16 nItemId ) const;
     150             :     Point               GetItemTextPos( sal_uInt16 nItemId ) const;
     151        9563 :     sal_uInt16              GetCurItemId() const { return mnCurItemId; }
     152             : 
     153             :     sal_uLong               GetItemWidth( sal_uInt16 nItemId ) const;
     154             :     StatusBarItemBits   GetItemBits( sal_uInt16 nItemId ) const;
     155             : 
     156             :     long                GetItemOffset( sal_uInt16 nItemId ) const;
     157             : 
     158             :     void                SetItemText( sal_uInt16 nItemId, const OUString& rText );
     159             :     const OUString&    GetItemText( sal_uInt16 nItemId ) const;
     160             : 
     161             :     void                SetItemData( sal_uInt16 nItemId, void* pNewData );
     162             :     void*               GetItemData( sal_uInt16 nItemId ) const;
     163             : 
     164             :     void                SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
     165             :     const OUString      GetItemCommand( sal_uInt16 nItemId );
     166             : 
     167             :     void                SetHelpText( sal_uInt16 nItemId, const OUString& rText );
     168             :     const OUString&    GetHelpText( sal_uInt16 nItemId ) const;
     169             : 
     170             :     using Window::SetQuickHelpText;
     171             :     void                SetQuickHelpText( sal_uInt16 nItemId, const OUString& rText );
     172             :     using Window::GetQuickHelpText;
     173             :     const OUString&     GetQuickHelpText( sal_uInt16 nItemId ) const;
     174             : 
     175             :     void                SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
     176             :     OString             GetHelpId( sal_uInt16 nItemId ) const;
     177             : 
     178             :     void                StartProgressMode( const OUString& rText );
     179             :     void                SetProgressValue( sal_uInt16 nPercent );
     180             :     void                EndProgressMode();
     181       21684 :     bool                IsProgressMode() const { return mbProgressMode; }
     182             : 
     183             :     void                SetText( const OUString& rText ) SAL_OVERRIDE;
     184             : 
     185             :     void                SetHelpText( const OUString& rText )
     186             :                             { Window::SetHelpText( rText ); }
     187             :     const OUString&    GetHelpText() const
     188             :                             { return Window::GetHelpText(); }
     189             : 
     190             :     void                SetHelpId( const OString& rId )
     191             :                             { Window::SetHelpId( rId ); }
     192             :     const OString&      GetHelpId() const
     193             :                             { return Window::GetHelpId(); }
     194             : 
     195             :     Size                CalcWindowSizePixel() const;
     196             : 
     197        2056 :     void                SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
     198             :     const Link&         GetClickHdl() const { return maClickHdl; }
     199        2056 :     void                SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
     200             :     const Link&         GetDoubleClickHdl() const { return maDoubleClickHdl; }
     201             : 
     202             :     using Window::SetAccessibleName;
     203             :     void                SetAccessibleName( sal_uInt16 nItemId, const OUString& rName );
     204             :     using Window::GetAccessibleName;
     205             :     const OUString&     GetAccessibleName( sal_uInt16 nItemId ) const;
     206             : };
     207             : 
     208             : #endif // INCLUDED_VCL_STATUS_HXX
     209             : 
     210             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10