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 : #include "GraphicViewShell.hxx"
21 : #include "LayerTabBar.hxx"
22 : #include "FrameView.hxx"
23 : #include <sfx2/objsh.hxx>
24 : #include <sfx2/viewfrm.hxx>
25 : #include <vcl/scrbar.hxx>
26 : #include <vcl/settings.hxx>
27 :
28 : #include <tools/helpers.hxx>
29 :
30 : namespace sd {
31 :
32 86 : GraphicViewShell::GraphicViewShell (
33 : SfxViewFrame* pFrame,
34 : ViewShellBase& rViewShellBase,
35 : vcl::Window* pParentWindow,
36 : FrameView* pFrameView)
37 : : DrawViewShell (
38 : pFrame,
39 : rViewShellBase,
40 : pParentWindow,
41 : PK_STANDARD,
42 86 : pFrameView)
43 : {
44 86 : ConstructGraphicViewShell();
45 86 : }
46 :
47 172 : GraphicViewShell::~GraphicViewShell()
48 : {
49 172 : }
50 :
51 86 : void GraphicViewShell::ConstructGraphicViewShell()
52 : {
53 86 : meShellType = ST_DRAW;
54 :
55 86 : mpLayerTabBar.reset (VclPtr<LayerTabBar>::Create(this, GetParentWindow()));
56 :
57 : // #i67363# no layer tabbar in preview mode
58 86 : if ( !GetObjectShell()->IsPreview() )
59 86 : mpLayerTabBar->Show();
60 86 : }
61 :
62 421 : void GraphicViewShell::ChangeEditMode (
63 : EditMode eMode,
64 : bool )
65 : {
66 : // There is no page tab that could be shown instead of the layer tab.
67 : // Therefore we have it always visible regardless of what the caller
68 : // said. (We have to change the callers behaviour, of course.)
69 421 : DrawViewShell::ChangeEditMode (eMode, true);
70 421 : }
71 :
72 230 : void GraphicViewShell::ArrangeGUIElements()
73 : {
74 230 : if (mpLayerTabBar.get()!=NULL && mpLayerTabBar->IsVisible())
75 : {
76 230 : Size aSize = mpLayerTabBar->GetSizePixel();
77 230 : const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel());
78 :
79 230 : aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4;
80 230 : aSize.Width() = aFrameSize.Width();
81 :
82 230 : Point aPos (0, maViewSize.Height() - aSize.Height());
83 :
84 230 : mpLayerTabBar->SetPosSizePixel (aPos, aSize);
85 : }
86 :
87 230 : DrawViewShell::ArrangeGUIElements();
88 230 : }
89 :
90 66 : } // end of namespace sd
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|