LibreOffice Module sd (master) 1
RemoteDialogClientBox.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
20#pragma once
21
22#include <vcl/weld.hxx>
23
24#include <memory>
25
26namespace sd {
27
28#define SMALL_ICON_SIZE 16
29#define TOP_OFFSET 5
30#define ICON_HEIGHT 42
31#define ICON_WIDTH 47
32#define ICON_OFFSET 72
33#define RIGHT_ICON_OFFSET 5
34#define SPACE_BETWEEN 3
35
36class ClientBox;
37struct ClientBoxEntry;
38struct ClientInfo;
39
40typedef std::shared_ptr<ClientBoxEntry> TClientBoxEntry;
41
43{
44 std::unique_ptr<weld::Builder> m_xBuilder;
45 std::unique_ptr<weld::Container> m_xContainer;
46 std::unique_ptr<weld::Label> m_xDeviceName;
47 std::unique_ptr<weld::Label> m_xPinLabel;
48 std::unique_ptr<weld::Entry> m_xPinBox;
49 std::unique_ptr<weld::Button> m_xDeauthoriseButton;
50
51 std::shared_ptr<ClientInfo> m_xClientInfo;
53
54 DECL_LINK(DeauthoriseHdl, weld::Button&, void);
55 DECL_LINK(FocusHdl, weld::Widget&, void);
56
57 ClientBoxEntry(ClientBox* pClientBox, std::shared_ptr<ClientInfo> pClientInfo);
59};
60
62{
63 std::unique_ptr<weld::ScrolledWindow> m_xScroll;
64 std::unique_ptr<weld::Container> m_xContents;
65
66 std::vector< TClientBoxEntry > m_vEntries;
68
69public:
70 ClientBox(std::unique_ptr<weld::ScrolledWindow> xScroll, std::unique_ptr<weld::Container> xContents);
72 ~ClientBox();
73
75
76 void addEntry(const std::shared_ptr<ClientInfo>& pClientInfo);
77 void setActive(ClientBoxEntry* pClientData);
78 void clearEntries();
79
80 void populateEntries();
81};
82
83} // end namespace sd
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void addEntry(const std::shared_ptr< ClientInfo > &pClientInfo)
std::unique_ptr< weld::ScrolledWindow > m_xScroll
ClientBoxEntry * GetActiveEntry()
void setActive(ClientBoxEntry *pClientData)
ClientBoxEntry * m_pActive
ClientBox(std::unique_ptr< weld::ScrolledWindow > xScroll, std::unique_ptr< weld::Container > xContents)
weld::Container * GetContainer()
std::unique_ptr< weld::Container > m_xContents
std::vector< TClientBoxEntry > m_vEntries
std::shared_ptr< ClientBoxEntry > TClientBoxEntry
DECL_LINK(FocusHdl, weld::Widget &, void)
std::unique_ptr< weld::Button > m_xDeauthoriseButton
std::unique_ptr< weld::Container > m_xContainer
std::shared_ptr< ClientInfo > m_xClientInfo
ClientBoxEntry(ClientBox *pClientBox, std::shared_ptr< ClientInfo > pClientInfo)
std::unique_ptr< weld::Entry > m_xPinBox
std::unique_ptr< weld::Label > m_xPinLabel
std::unique_ptr< weld::Label > m_xDeviceName
std::unique_ptr< weld::Builder > m_xBuilder
DECL_LINK(DeauthoriseHdl, weld::Button &, void)