1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_scui.hxx"
26
27
28
29
30 //------------------------------------------------------------------
31
32 #include "dapitype.hxx"
33 #include "scresid.hxx"
34 #include "sc.hrc"
35 #include "dapitype.hrc"
36
37 using namespace com::sun::star;
38
39 //-------------------------------------------------------------------------
40
ScDataPilotSourceTypeDlg(Window * pParent,sal_Bool bEnableExternal)41 ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ) :
42 ModalDialog ( pParent, ScResId( RID_SCDLG_DAPITYPE ) ),
43 //
44 aFlFrame ( this, ScResId( FL_FRAME ) ),
45 aBtnSelection ( this, ScResId( BTN_SELECTION ) ),
46 aBtnDatabase ( this, ScResId( BTN_DATABASE ) ),
47 aBtnExternal ( this, ScResId( BTN_EXTERNAL ) ),
48 aBtnOk ( this, ScResId( BTN_OK ) ),
49 aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
50 aBtnHelp ( this, ScResId( BTN_HELP ) )
51 {
52 if (!bEnableExternal)
53 aBtnExternal.Disable();
54
55 aBtnSelection.Check();
56
57 FreeResource();
58 }
59
~ScDataPilotSourceTypeDlg()60 ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
61 {
62 }
63
IsDatabase() const64 sal_Bool ScDataPilotSourceTypeDlg::IsDatabase() const
65 {
66 return aBtnDatabase.IsChecked();
67 }
68
IsExternal() const69 sal_Bool ScDataPilotSourceTypeDlg::IsExternal() const
70 {
71 return aBtnExternal.IsChecked();
72 }
73
74 //-------------------------------------------------------------------------
75
ScDataPilotServiceDlg(Window * pParent,const uno::Sequence<rtl::OUString> & rServices)76 ScDataPilotServiceDlg::ScDataPilotServiceDlg( Window* pParent,
77 const uno::Sequence<rtl::OUString>& rServices ) :
78 ModalDialog ( pParent, ScResId( RID_SCDLG_DAPISERVICE ) ),
79 //
80 aFlFrame ( this, ScResId( FL_FRAME ) ),
81 aFtService ( this, ScResId( FT_SERVICE ) ),
82 aLbService ( this, ScResId( LB_SERVICE ) ),
83 aFtSource ( this, ScResId( FT_SOURCE ) ),
84 aEdSource ( this, ScResId( ED_SOURCE ) ),
85 aFtName ( this, ScResId( FT_NAME ) ),
86 aEdName ( this, ScResId( ED_NAME ) ),
87 aFtUser ( this, ScResId( FT_USER ) ),
88 aEdUser ( this, ScResId( ED_USER ) ),
89 aFtPasswd ( this, ScResId( FT_PASSWD ) ),
90 aEdPasswd ( this, ScResId( ED_PASSWD ) ),
91 aBtnOk ( this, ScResId( BTN_OK ) ),
92 aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
93 aBtnHelp ( this, ScResId( BTN_HELP ) )
94 {
95 long nCount = rServices.getLength();
96 const rtl::OUString* pArray = rServices.getConstArray();
97 for (long i=0; i<nCount; i++)
98 {
99 String aName = pArray[i];
100 aLbService.InsertEntry( aName );
101 }
102 aLbService.SelectEntryPos( 0 );
103
104 FreeResource();
105 }
106
~ScDataPilotServiceDlg()107 ScDataPilotServiceDlg::~ScDataPilotServiceDlg()
108 {
109 }
110
GetServiceName() const111 String ScDataPilotServiceDlg::GetServiceName() const
112 {
113 return aLbService.GetSelectEntry();
114 }
115
GetParSource() const116 String ScDataPilotServiceDlg::GetParSource() const
117 {
118 return aEdSource.GetText();
119 }
120
GetParName() const121 String ScDataPilotServiceDlg::GetParName() const
122 {
123 return aEdName.GetText();
124 }
125
GetParUser() const126 String ScDataPilotServiceDlg::GetParUser() const
127 {
128 return aEdUser.GetText();
129 }
130
GetParPass() const131 String ScDataPilotServiceDlg::GetParPass() const
132 {
133 return aEdPasswd.GetText();
134 }
135
136
137
138