xref: /AOO41X/main/sfx2/source/sidebar/TitleBar.hxx (revision 65908a7e1f9ca9aa63df49ee1aa63f712b100da9)
122de8995SAndre Fischer /**************************************************************
222de8995SAndre Fischer  *
322de8995SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
422de8995SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
522de8995SAndre Fischer  * distributed with this work for additional information
622de8995SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
722de8995SAndre Fischer  * to you under the Apache License, Version 2.0 (the
822de8995SAndre Fischer  * "License"); you may not use this file except in compliance
922de8995SAndre Fischer  * with the License.  You may obtain a copy of the License at
1022de8995SAndre Fischer  *
1122de8995SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1222de8995SAndre Fischer  *
1322de8995SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1422de8995SAndre Fischer  * software distributed under the License is distributed on an
1522de8995SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1622de8995SAndre Fischer  * KIND, either express or implied.  See the License for the
1722de8995SAndre Fischer  * specific language governing permissions and limitations
1822de8995SAndre Fischer  * under the License.
1922de8995SAndre Fischer  *
2022de8995SAndre Fischer  *************************************************************/
2122de8995SAndre Fischer 
2222de8995SAndre Fischer #ifndef SFX_SIDEBAR_TITLE_BAR_HXX
2322de8995SAndre Fischer #define SFX_SIDEBAR_TITLE_BAR_HXX
2422de8995SAndre Fischer 
25ff12d537SAndre Fischer #include "Paint.hxx"
267a32b0c8SAndre Fischer 
277a32b0c8SAndre Fischer #include <vcl/window.hxx>
287a32b0c8SAndre Fischer #include <vcl/toolbox.hxx>
2922de8995SAndre Fischer 
3022de8995SAndre Fischer 
31ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
3222de8995SAndre Fischer 
3322de8995SAndre Fischer class TitleBar
3422de8995SAndre Fischer     : public Window
3522de8995SAndre Fischer {
3622de8995SAndre Fischer public:
3722de8995SAndre Fischer     TitleBar (
3822de8995SAndre Fischer         const ::rtl::OUString& rsTitle,
397a32b0c8SAndre Fischer         Window* pParentWindow,
407a32b0c8SAndre Fischer         const sidebar::Paint& rInitialBackgroundPaint);
4122de8995SAndre Fischer     virtual ~TitleBar (void);
4222de8995SAndre Fischer 
4354eaaa32SAndre Fischer     void SetTitle (const ::rtl::OUString& rsTitle);
4454eaaa32SAndre Fischer 
4522de8995SAndre Fischer     virtual void Paint (const Rectangle& rUpdateArea);
467a32b0c8SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
477a32b0c8SAndre Fischer     virtual void SetPosSizePixel (
487a32b0c8SAndre Fischer         long nX,
497a32b0c8SAndre Fischer         long nY,
507a32b0c8SAndre Fischer         long nWidth,
517a32b0c8SAndre Fischer         long nHeight,
527a32b0c8SAndre Fischer         sal_uInt16 nFlags = WINDOW_POSSIZE_ALL);
5322de8995SAndre Fischer 
54*65908a7eSAndre Fischer     ToolBox& GetToolBox (void);
55*65908a7eSAndre Fischer 
56ff12d537SAndre Fischer protected:
577a32b0c8SAndre Fischer     ToolBox maToolBox;
587a32b0c8SAndre Fischer 
59ff12d537SAndre Fischer     virtual Rectangle GetTitleArea (const Rectangle& rTitleBarBox) = 0;
60ff12d537SAndre Fischer     virtual void PaintDecoration (const Rectangle& rTitleBarBox) = 0;
61*65908a7eSAndre Fischer     virtual void PaintFocus (const Rectangle& rFocusBox);
62ff12d537SAndre Fischer     virtual sidebar::Paint GetBackgroundPaint (void) = 0;
63ff12d537SAndre Fischer     virtual Color GetTextColor (void) = 0;
647a32b0c8SAndre Fischer     virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex);
65ff12d537SAndre Fischer 
6622de8995SAndre Fischer private:
6754eaaa32SAndre Fischer     ::rtl::OUString msTitle;
68ff12d537SAndre Fischer 
69ff12d537SAndre Fischer     void PaintTitle (const Rectangle& rTitleBox);
707a32b0c8SAndre Fischer     DECL_LINK(SelectionHandler, ToolBox*);
7122de8995SAndre Fischer };
7222de8995SAndre Fischer 
7322de8995SAndre Fischer 
74ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
7522de8995SAndre Fischer 
7622de8995SAndre Fischer #endif
77