xref: /aoo4110/main/sc/source/ui/dbgui/dapitype.cxx (revision b1cdbd2c)
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_sc.hxx"
26 
27 #undef SC_DLLIMPLEMENTATION
28 
29 
30 
31 //------------------------------------------------------------------
32 
33 #include "dapitype.hxx"
34 #include "scresid.hxx"
35 #include "sc.hrc"
36 #include "dapitype.hrc"
37 
38 using namespace com::sun::star;
39 
40 //-------------------------------------------------------------------------
41 
ScDataPilotSourceTypeDlg(Window * pParent,sal_Bool bEnableExternal)42 ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ) :
43 	ModalDialog     ( pParent, ScResId( RID_SCDLG_DAPITYPE ) ),
44 	//
45     aFlFrame        ( this, ScResId( FL_FRAME ) ),
46 	aBtnSelection   ( this, ScResId( BTN_SELECTION ) ),
47 	aBtnDatabase    ( this, ScResId( BTN_DATABASE ) ),
48 	aBtnExternal    ( this, ScResId( BTN_EXTERNAL ) ),
49 	aBtnOk          ( this, ScResId( BTN_OK ) ),
50 	aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
51 	aBtnHelp        ( this, ScResId( BTN_HELP ) )
52 {
53 	if (!bEnableExternal)
54 		aBtnExternal.Disable();
55 
56 	aBtnSelection.Check();
57 
58 	FreeResource();
59 }
60 
~ScDataPilotSourceTypeDlg()61 ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
62 {
63 }
64 
IsDatabase() const65 sal_Bool ScDataPilotSourceTypeDlg::IsDatabase() const
66 {
67 	return aBtnDatabase.IsChecked();
68 }
69 
IsExternal() const70 sal_Bool ScDataPilotSourceTypeDlg::IsExternal() const
71 {
72 	return aBtnExternal.IsChecked();
73 }
74 
75 //-------------------------------------------------------------------------
76 
ScDataPilotServiceDlg(Window * pParent,const uno::Sequence<rtl::OUString> & rServices)77 ScDataPilotServiceDlg::ScDataPilotServiceDlg( Window* pParent,
78 								const uno::Sequence<rtl::OUString>& rServices ) :
79 	ModalDialog     ( pParent, ScResId( RID_SCDLG_DAPISERVICE ) ),
80 	//
81     aFlFrame        ( this, ScResId( FL_FRAME ) ),
82 	aFtService      ( this, ScResId( FT_SERVICE ) ),
83 	aLbService      ( this, ScResId( LB_SERVICE ) ),
84 	aFtSource		( this, ScResId( FT_SOURCE ) ),
85 	aEdSource		( this, ScResId( ED_SOURCE ) ),
86 	aFtName			( this, ScResId( FT_NAME ) ),
87 	aEdName			( this, ScResId( ED_NAME ) ),
88 	aFtUser			( this, ScResId( FT_USER ) ),
89 	aEdUser			( this, ScResId( ED_USER ) ),
90 	aFtPasswd		( this, ScResId( FT_PASSWD ) ),
91 	aEdPasswd		( this, ScResId( ED_PASSWD ) ),
92 	aBtnOk          ( this, ScResId( BTN_OK ) ),
93 	aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
94 	aBtnHelp        ( this, ScResId( BTN_HELP ) )
95 {
96 	long nCount = rServices.getLength();
97 	const rtl::OUString* pArray = rServices.getConstArray();
98 	for (long i=0; i<nCount; i++)
99 	{
100 		String aName = pArray[i];
101 		aLbService.InsertEntry( aName );
102 	}
103 	aLbService.SelectEntryPos( 0 );
104 
105 	FreeResource();
106 }
107 
~ScDataPilotServiceDlg()108 ScDataPilotServiceDlg::~ScDataPilotServiceDlg()
109 {
110 }
111 
GetServiceName() const112 String ScDataPilotServiceDlg::GetServiceName() const
113 {
114 	return aLbService.GetSelectEntry();
115 }
116 
GetParSource() const117 String ScDataPilotServiceDlg::GetParSource() const
118 {
119 	return aEdSource.GetText();
120 }
121 
GetParName() const122 String ScDataPilotServiceDlg::GetParName() const
123 {
124 	return aEdName.GetText();
125 }
126 
GetParUser() const127 String ScDataPilotServiceDlg::GetParUser() const
128 {
129 	return aEdUser.GetText();
130 }
131 
GetParPass() const132 String ScDataPilotServiceDlg::GetParPass() const
133 {
134 	return aEdPasswd.GetText();
135 }
136 
137 
138 
139