LibreOffice Module sfx2 (master)
1
include
sfx2
sidebar
FocusManager.hxx
Go to the documentation of this file.
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
#pragma once
20
21
#include <
sfx2/sidebar/Panel.hxx
>
22
#include <
tools/link.hxx
>
23
#include <
vcl/keycod.hxx
>
24
25
namespace
weld
{
26
class
Widget
;
27
}
28
29
namespace
sfx2::sidebar
{
30
31
class
DeckTitleBar;
32
50
class
FocusManager
51
{
52
public
:
53
FocusManager
(std::function<
void
(
const
Panel
&)> aShowPanelFunctor);
54
~FocusManager
();
55
58
void
Clear
();
59
64
void
GrabFocus
();
65
void
GrabFocusPanel
();
66
67
void
SetDeck
(
Deck
* pDeck);
68
void
SetPanels
(
const
SharedPanelContainer
& rPanels);
69
void
SetButtons
(
const
std::vector<weld::Widget*>& rButtons);
70
71
private
:
72
VclPtr<Deck>
mxDeck
;
73
DeckTitleBar
*
mpDeckTitleBar
;
74
SharedPanelContainer
maPanels
;
75
std::vector<weld::Widget*>
maButtons
;
76
const
std::function<void(
const
Panel
&)>
maShowPanelFunctor
;
77
78
enum
PanelComponent
79
{
80
PC_DeckToolBox
,
81
PC_PanelTitle
,
82
PC_PanelToolBox
,
83
PC_PanelContent
,
84
PC_TabBar
,
85
PC_None
86
};
87
class
FocusLocation
88
{
89
public
:
90
PanelComponent
meComponent
;
91
sal_Int32
mnIndex
;
92
FocusLocation
(
const
PanelComponent
eComponent,
const
sal_Int32 nIndex);
93
};
94
97
DECL_LINK
(KeyInputHdl,
const
KeyEvent
&,
bool
);
98
99
void
ClearPanels
();
100
void
ClearButtons
();
101
105
void
RegisterWindow
(
weld::Widget
& rWidget);
106
static
void
UnregisterWindow
(
weld::Widget
& rWidget);
107
108
void
FocusDeckTitle
();
109
bool
IsDeckTitleVisible
()
const
;
110
bool
IsPanelTitleVisible
(
const
sal_Int32 nPanelIndex)
const
;
111
121
void
FocusPanel
(
const
sal_Int32 nPanelIndex,
122
const
bool
bFallbackToDeckTitle);
123
124
void
FocusPanelContent
(
const
sal_Int32 nPanelIndex);
125
void
FocusButton
(
const
sal_Int32 nButtonIndex);
126
void
MoveFocusInsidePanel
(
const
FocusLocation
& rLocation,
127
const
sal_Int32 nDirection);
128
bool
MoveFocusInsideDeckTitle
(
const
FocusLocation
& rLocation,
129
const
sal_Int32 nDirection);
130
131
bool
HandleKeyEvent
(
const
vcl::KeyCode
& rKeyCode,
132
const
FocusLocation
& rLocation);
133
134
FocusLocation
GetFocusLocation
()
const
;
135
136
};
137
138
}
// end of namespace sfx2::sidebar
139
140
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Panel.hxx
KeyEvent
VclPtr
sfx2::sidebar::DeckTitleBar
Definition:
DeckTitleBar.hxx:30
sfx2::sidebar::Deck
This is the parent window of the panels.
Definition:
Deck.hxx:38
sfx2::sidebar::FocusManager::FocusLocation
Definition:
FocusManager.hxx:88
sfx2::sidebar::FocusManager::FocusLocation::meComponent
PanelComponent meComponent
Definition:
FocusManager.hxx:90
sfx2::sidebar::FocusManager::FocusLocation::FocusLocation
FocusLocation(const PanelComponent eComponent, const sal_Int32 nIndex)
Definition:
FocusManager.cxx:33
sfx2::sidebar::FocusManager::FocusLocation::mnIndex
sal_Int32 mnIndex
Definition:
FocusManager.hxx:91
sfx2::sidebar::FocusManager
Concentrate all focus handling in this class.
Definition:
FocusManager.hxx:51
sfx2::sidebar::FocusManager::IsPanelTitleVisible
bool IsPanelTitleVisible(const sal_Int32 nPanelIndex) const
Definition:
FocusManager.cxx:196
sfx2::sidebar::FocusManager::SetButtons
void SetButtons(const std::vector< weld::Widget * > &rButtons)
Definition:
FocusManager.cxx:124
sfx2::sidebar::FocusManager::PanelComponent
PanelComponent
Definition:
FocusManager.hxx:79
sfx2::sidebar::FocusManager::PC_TabBar
@ PC_TabBar
Definition:
FocusManager.hxx:84
sfx2::sidebar::FocusManager::PC_PanelContent
@ PC_PanelContent
Definition:
FocusManager.hxx:83
sfx2::sidebar::FocusManager::PC_None
@ PC_None
Definition:
FocusManager.hxx:85
sfx2::sidebar::FocusManager::PC_PanelToolBox
@ PC_PanelToolBox
Definition:
FocusManager.hxx:82
sfx2::sidebar::FocusManager::PC_PanelTitle
@ PC_PanelTitle
Definition:
FocusManager.hxx:81
sfx2::sidebar::FocusManager::PC_DeckToolBox
@ PC_DeckToolBox
Definition:
FocusManager.hxx:80
sfx2::sidebar::FocusManager::maShowPanelFunctor
const std::function< void(const Panel &)> maShowPanelFunctor
Definition:
FocusManager.hxx:76
sfx2::sidebar::FocusManager::GrabFocus
void GrabFocus()
Transfer the focus into the sidebar tree of windows.
Definition:
FocusManager.cxx:50
sfx2::sidebar::FocusManager::HandleKeyEvent
bool HandleKeyEvent(const vcl::KeyCode &rKeyCode, const FocusLocation &rLocation)
Definition:
FocusManager.cxx:307
sfx2::sidebar::FocusManager::ClearPanels
void ClearPanels()
Definition:
FocusManager.cxx:67
sfx2::sidebar::FocusManager::DECL_LINK
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
Listen for key events for panels and buttons.
sfx2::sidebar::FocusManager::FocusButton
void FocusButton(const sal_Int32 nButtonIndex)
Definition:
FocusManager.cxx:253
sfx2::sidebar::FocusManager::mxDeck
VclPtr< Deck > mxDeck
Definition:
FocusManager.hxx:72
sfx2::sidebar::FocusManager::MoveFocusInsideDeckTitle
bool MoveFocusInsideDeckTitle(const FocusLocation &rLocation, const sal_Int32 nDirection)
Definition:
FocusManager.cxx:284
sfx2::sidebar::FocusManager::GetFocusLocation
FocusLocation GetFocusLocation() const
Definition:
FocusManager.cxx:145
sfx2::sidebar::FocusManager::GrabFocusPanel
void GrabFocusPanel()
Definition:
FocusManager.cxx:55
sfx2::sidebar::FocusManager::ClearButtons
void ClearButtons()
Definition:
FocusManager.cxx:84
sfx2::sidebar::FocusManager::FocusPanel
void FocusPanel(const sal_Int32 nPanelIndex, const bool bFallbackToDeckTitle)
Set the focus to the title bar of the panel or, if the title bar is not visible, directly to the pane...
Definition:
FocusManager.cxx:207
sfx2::sidebar::FocusManager::SetPanels
void SetPanels(const SharedPanelContainer &rPanels)
Definition:
FocusManager.cxx:105
sfx2::sidebar::FocusManager::IsDeckTitleVisible
bool IsDeckTitleVisible() const
Definition:
FocusManager.cxx:191
sfx2::sidebar::FocusManager::UnregisterWindow
static void UnregisterWindow(weld::Widget &rWidget)
Definition:
FocusManager.cxx:140
sfx2::sidebar::FocusManager::~FocusManager
~FocusManager()
Definition:
FocusManager.cxx:45
sfx2::sidebar::FocusManager::FocusDeckTitle
void FocusDeckTitle()
Definition:
FocusManager.cxx:175
sfx2::sidebar::FocusManager::maPanels
SharedPanelContainer maPanels
Definition:
FocusManager.hxx:74
sfx2::sidebar::FocusManager::mpDeckTitleBar
DeckTitleBar * mpDeckTitleBar
Definition:
FocusManager.hxx:73
sfx2::sidebar::FocusManager::Clear
void Clear()
Forget all panels and buttons.
Definition:
FocusManager.cxx:60
sfx2::sidebar::FocusManager::FocusManager
FocusManager(std::function< void(const Panel &)> aShowPanelFunctor)
Definition:
FocusManager.cxx:39
sfx2::sidebar::FocusManager::FocusPanelContent
void FocusPanelContent(const sal_Int32 nPanelIndex)
Definition:
FocusManager.cxx:244
sfx2::sidebar::FocusManager::maButtons
std::vector< weld::Widget * > maButtons
Definition:
FocusManager.hxx:75
sfx2::sidebar::FocusManager::MoveFocusInsidePanel
void MoveFocusInsidePanel(const FocusLocation &rLocation, const sal_Int32 nDirection)
Definition:
FocusManager.cxx:258
sfx2::sidebar::FocusManager::SetDeck
void SetDeck(Deck *pDeck)
Definition:
FocusManager.cxx:94
sfx2::sidebar::FocusManager::RegisterWindow
void RegisterWindow(weld::Widget &rWidget)
Let the focus manager listen for window events for the given window.
Definition:
FocusManager.cxx:134
sfx2::sidebar::Panel
Multiple panels form a single deck.
Definition:
Panel.hxx:54
vcl::KeyCode
weld::Widget
keycod.hxx
link.hxx
sfx2::sidebar
Definition:
appdata.hxx:56
sfx2::sidebar::SharedPanelContainer
std::vector< std::shared_ptr< Panel > > SharedPanelContainer
Definition:
Panel.hxx:118
PDFAnnotationSubType::Widget
@ Widget
weld
Generated on Sun Jul 30 2023 04:33:35 for LibreOffice Module sfx2 (master) by
1.9.3