2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $TOG: PropUi.C /main/6 1998/02/17 15:18:54 mgreess $ */
27 * RESTRICTED CONFIDENTIAL INFORMATION:
29 * The information in this document is subject to special
30 * restrictions in a confidential disclosure agreement bertween
31 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
32 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
33 * Sun's specific written approval. This documment and all copies
34 * and derivative works thereof must be returned or destroyed at
37 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
43 #include <DtMail/DtVirtArray.hh>
44 #include <DtMail/PropUi.hh>
45 #include <DtMail/PropSource.hh>
48 // PropUiItem::PropUiItem
50 ////////////////////////////////////////////////////////////////
51 PropUiItem::PropUiItem( Widget w,
54 PropUiCallback validator,
61 key = strdup(search_key);
62 _uiValueValidator = validator;
63 _uiValueValidatorData = validator_data;
65 DtMail::Session * d_session = NULL;
66 DtMail::MailRc * m_rc = NULL;
71 d_session = theRoamApp.session()->session();
72 m_rc = d_session->mailRc(error);
73 prop_source = (PropSource *) new MailRcSource(m_rc, key );
78 fprintf(stderr, "Error in PropUiItem ctor\n");
83 // PropUiItem::~PropUiItem
85 ////////////////////////////////////////////////////////////////
86 PropUiItem::~PropUiItem()
88 // release memory alloced by the class
94 // Returns NULL if the PropUiItem has a valid value; NLS error message if not.
95 ////////////////////////////////////////////////////////////////
96 char * PropUiItem::uiValueIsValid()
98 if (NULL == _uiValueValidator) return NULL;
99 return _uiValueValidator(this, _uiValueValidatorData);