LibreOffice Module chart2 (master) 1
res_Titles.cxx
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#include <res_Titles.hxx>
21#include <TitleDialogData.hxx>
22#include <vcl/weld.hxx>
23
24namespace chart
25{
26TitleResources::TitleResources(weld::Builder& rBuilder, bool bShowSecondaryAxesTitle)
27 : m_xFT_Main(rBuilder.weld_label("labelMainTitle"))
28 , m_xFT_Sub(rBuilder.weld_label("labelSubTitle"))
29 , m_xEd_Main(rBuilder.weld_entry("maintitle"))
30 , m_xEd_Sub(rBuilder.weld_entry("subtitle"))
31 , m_xFT_XAxis(rBuilder.weld_label("labelPrimaryXaxis"))
32 , m_xFT_YAxis(rBuilder.weld_label("labelPrimaryYaxis"))
33 , m_xFT_ZAxis(rBuilder.weld_label("labelPrimaryZaxis"))
34 , m_xEd_XAxis(rBuilder.weld_entry("primaryXaxis"))
35 , m_xEd_YAxis(rBuilder.weld_entry("primaryYaxis"))
36 , m_xEd_ZAxis(rBuilder.weld_entry("primaryZaxis"))
37 , m_xFT_SecondaryXAxis(rBuilder.weld_label("labelSecondaryXAxis"))
38 , m_xFT_SecondaryYAxis(rBuilder.weld_label("labelSecondaryYAxis"))
39 , m_xEd_SecondaryXAxis(rBuilder.weld_entry("secondaryXaxis"))
40 , m_xEd_SecondaryYAxis(rBuilder.weld_entry("secondaryYaxis"))
41{
42 m_xFT_SecondaryXAxis->set_visible(bShowSecondaryAxesTitle);
43 m_xFT_SecondaryYAxis->set_visible(bShowSecondaryAxesTitle);
44 m_xEd_SecondaryXAxis->set_visible(bShowSecondaryAxesTitle);
45 m_xEd_SecondaryYAxis->set_visible(bShowSecondaryAxesTitle);
46}
47
49
51{
52 m_xEd_Main->connect_changed(rLink);
53 m_xEd_Sub->connect_changed(rLink);
54 m_xEd_XAxis->connect_changed(rLink);
55 m_xEd_YAxis->connect_changed(rLink);
56 m_xEd_ZAxis->connect_changed(rLink);
57 m_xEd_SecondaryXAxis->connect_changed(rLink);
58 m_xEd_SecondaryYAxis->connect_changed(rLink);
59}
60
62{
63 return m_xEd_Main->get_value_changed_from_saved() || m_xEd_Sub->get_value_changed_from_saved()
64 || m_xEd_XAxis->get_value_changed_from_saved()
65 || m_xEd_YAxis->get_value_changed_from_saved()
66 || m_xEd_ZAxis->get_value_changed_from_saved()
67 || m_xEd_SecondaryXAxis->get_value_changed_from_saved()
68 || m_xEd_SecondaryYAxis->get_value_changed_from_saved();
69}
70
72{
73 m_xEd_Main->save_value();
74 m_xEd_Sub->save_value();
75 m_xEd_XAxis->save_value();
76 m_xEd_YAxis->save_value();
77 m_xEd_ZAxis->save_value();
78 m_xEd_SecondaryXAxis->save_value();
79 m_xEd_SecondaryYAxis->save_value();
80}
81
83{
84 m_xFT_Main->set_sensitive(rInput.aPossibilityList[0]);
85 m_xFT_Sub->set_sensitive(rInput.aPossibilityList[1]);
86 m_xFT_XAxis->set_sensitive(rInput.aPossibilityList[2]);
87 m_xFT_YAxis->set_sensitive(rInput.aPossibilityList[3]);
88 m_xFT_ZAxis->set_sensitive(rInput.aPossibilityList[4]);
89 m_xFT_SecondaryXAxis->set_sensitive(rInput.aPossibilityList[5]);
90 m_xFT_SecondaryYAxis->set_sensitive(rInput.aPossibilityList[6]);
91
92 m_xEd_Main->set_sensitive(rInput.aPossibilityList[0]);
93 m_xEd_Sub->set_sensitive(rInput.aPossibilityList[1]);
94 m_xEd_XAxis->set_sensitive(rInput.aPossibilityList[2]);
95 m_xEd_YAxis->set_sensitive(rInput.aPossibilityList[3]);
96 m_xEd_ZAxis->set_sensitive(rInput.aPossibilityList[4]);
97 m_xEd_SecondaryXAxis->set_sensitive(rInput.aPossibilityList[5]);
98 m_xEd_SecondaryYAxis->set_sensitive(rInput.aPossibilityList[6]);
99
100 m_xEd_Main->set_text(rInput.aTextList[0]);
101 m_xEd_Sub->set_text(rInput.aTextList[1]);
102 m_xEd_XAxis->set_text(rInput.aTextList[2]);
103 m_xEd_YAxis->set_text(rInput.aTextList[3]);
104 m_xEd_ZAxis->set_text(rInput.aTextList[4]);
105 m_xEd_SecondaryXAxis->set_text(rInput.aTextList[5]);
106 m_xEd_SecondaryYAxis->set_text(rInput.aTextList[6]);
107}
108
110{
111 sal_Bool* pExistenceList = rOutput.aExistenceList.getArray();
112 pExistenceList[0] = !m_xEd_Main->get_text().isEmpty();
113 pExistenceList[1] = !m_xEd_Sub->get_text().isEmpty();
114 pExistenceList[2] = !m_xEd_XAxis->get_text().isEmpty();
115 pExistenceList[3] = !m_xEd_YAxis->get_text().isEmpty();
116 pExistenceList[4] = !m_xEd_ZAxis->get_text().isEmpty();
117 pExistenceList[5] = !m_xEd_SecondaryXAxis->get_text().isEmpty();
118 pExistenceList[6] = !m_xEd_SecondaryYAxis->get_text().isEmpty();
119
120 auto pTextList = rOutput.aTextList.getArray();
121 pTextList[0] = m_xEd_Main->get_text();
122 pTextList[1] = m_xEd_Sub->get_text();
123 pTextList[2] = m_xEd_XAxis->get_text();
124 pTextList[3] = m_xEd_YAxis->get_text();
125 pTextList[4] = m_xEd_ZAxis->get_text();
126 pTextList[5] = m_xEd_SecondaryXAxis->get_text();
127 pTextList[6] = m_xEd_SecondaryYAxis->get_text();
128}
129
130} //namespace chart
131
132/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xFT_YAxis
Definition: res_Titles.hxx:59
std::unique_ptr< weld::Entry > m_xEd_SecondaryYAxis
Definition: res_Titles.hxx:68
bool get_value_changed_from_saved() const
Definition: res_Titles.cxx:61
std::unique_ptr< weld::Entry > m_xEd_YAxis
Definition: res_Titles.hxx:62
std::unique_ptr< weld::Entry > m_xEd_ZAxis
Definition: res_Titles.hxx:63
std::unique_ptr< weld::Entry > m_xEd_SecondaryXAxis
Definition: res_Titles.hxx:67
std::unique_ptr< weld::Label > m_xFT_SecondaryYAxis
Definition: res_Titles.hxx:66
std::unique_ptr< weld::Entry > m_xEd_Sub
Definition: res_Titles.hxx:56
std::unique_ptr< weld::Label > m_xFT_Main
Definition: res_Titles.hxx:53
std::unique_ptr< weld::Label > m_xFT_SecondaryXAxis
Definition: res_Titles.hxx:65
std::unique_ptr< weld::Entry > m_xEd_Main
Definition: res_Titles.hxx:55
std::unique_ptr< weld::Label > m_xFT_Sub
Definition: res_Titles.hxx:54
void writeToResources(const TitleDialogData &rInput)
Definition: res_Titles.cxx:82
std::unique_ptr< weld::Label > m_xFT_ZAxis
Definition: res_Titles.hxx:60
std::unique_ptr< weld::Entry > m_xEd_XAxis
Definition: res_Titles.hxx:61
void connect_changed(const Link< weld::Entry &, void > &rLink)
Definition: res_Titles.cxx:50
std::unique_ptr< weld::Label > m_xFT_XAxis
Definition: res_Titles.hxx:58
void readFromResources(TitleDialogData &rOutput)
Definition: res_Titles.cxx:109
TitleResources(weld::Builder &rParent, bool bShowSecondaryAxesTitle)
Definition: res_Titles.cxx:26
css::uno::Sequence< OUString > aTextList
css::uno::Sequence< sal_Bool > aPossibilityList
css::uno::Sequence< sal_Bool > aExistenceList
unsigned char sal_Bool