LCOV - code coverage report
Current view: top level - cui/source/dialogs - dlgname.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 71 0.0 %
Date: 2014-04-14 Functions: 0 15 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <tools/shl.hxx>
      21             : #include <vcl/msgbox.hxx>
      22             : 
      23             : #include <cuires.hrc>
      24             : 
      25             : #include "dlgname.hxx"
      26             : #include "defdlgname.hxx"
      27             : #include <dialmgr.hxx>
      28             : 
      29             : /*************************************************************************
      30             : |*
      31             : |* Dialog for editing a name
      32             : |*
      33             : \************************************************************************/
      34             : 
      35           0 : SvxNameDialog::SvxNameDialog( Window* pWindow, const OUString& rName, const OUString& rDesc ) :
      36           0 :     ModalDialog     ( pWindow, "NameDialog", "cui/ui/namedialog.ui" )
      37             : {
      38           0 :     get(pBtnOK, "ok");
      39           0 :     get(pFtDescription, "description_label");
      40           0 :     get(pEdtName, "name_entry");
      41             : 
      42           0 :     pFtDescription->SetText( rDesc );
      43           0 :     pEdtName->SetText( rName );
      44           0 :     pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
      45           0 :     ModifyHdl(&pEdtName);
      46           0 :     pEdtName->SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
      47           0 : }
      48             : 
      49           0 : IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl)
      50             : {
      51           0 :     if(aCheckNameHdl.IsSet())
      52           0 :         pBtnOK->Enable(aCheckNameHdl.Call(this) > 0);
      53           0 :     return 0;
      54             : }
      55             : 
      56             : 
      57             : // #i68101#
      58             : // Dialog for editing Object Name
      59             : // plus uniqueness-callback-linkHandler
      60             : 
      61           0 : SvxObjectNameDialog::SvxObjectNameDialog(
      62             :     Window* pWindow,
      63             :     const OUString& rName) :
      64           0 :     ModalDialog     ( pWindow, "ObjectNameDialog", "cui/ui/objectnamedialog.ui" )
      65             : {
      66           0 :     get(pBtnOK, "ok");
      67           0 :     get(pEdtName, "object_name_entry");
      68             :     // set name
      69           0 :     pEdtName->SetText(rName);
      70             : 
      71             :     // activate name
      72           0 :     pEdtName->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
      73           0 :     ModifyHdl(&pEdtName);
      74           0 :     pEdtName->SetModifyHdl(LINK(this, SvxObjectNameDialog, ModifyHdl));
      75           0 : }
      76             : 
      77           0 : IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl)
      78             : {
      79           0 :     if(aCheckNameHdl.IsSet())
      80             :     {
      81           0 :         pBtnOK->Enable(aCheckNameHdl.Call(this) > 0);
      82             :     }
      83             : 
      84           0 :     return 0;
      85             : }
      86             : 
      87             : 
      88             : // #i68101#
      89             : // Dialog for editing Object Title and Description
      90             : 
      91           0 : SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
      92             :     Window* pWindow,
      93             :     const OUString& rTitle,
      94             :     const OUString& rDescription) :
      95           0 :     ModalDialog     ( pWindow, "ObjectTitleDescDialog", "cui/ui/objecttitledescdialog.ui" )
      96             : {
      97           0 :     get(pEdtTitle, "object_title_entry");
      98           0 :     get(pEdtDescription, "desc_entry");
      99             :     //lock height to initial height
     100           0 :     pEdtDescription->set_height_request(pEdtDescription->get_preferred_size().Height());
     101             :     // set title & desc
     102           0 :     pEdtTitle->SetText(rTitle);
     103           0 :     pEdtDescription->SetText(rDescription);
     104             : 
     105             :     // activate title
     106           0 :     pEdtTitle->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
     107           0 : }
     108             : 
     109             : 
     110             : 
     111             : /*************************************************************************
     112             : |*
     113             : |* dialog for cancelling, saving or adding
     114             : |*
     115             : \************************************************************************/
     116             : 
     117           0 : SvxMessDialog::SvxMessDialog( Window* pWindow, const OUString& rText, const OUString& rDesc, Image* pImg )
     118             :     : ModalDialog(pWindow, "MessBox", "cui/ui/messbox.ui")
     119           0 :     , pImage(NULL)
     120             : {
     121           0 :     get(pBtn1, "mess_box_btn1");
     122           0 :     get(pBtn2, "mess_box_btn2");
     123           0 :     get(pFtDescription, "mess_box_description");
     124           0 :     get(pFtImage, "mess_box_image");
     125           0 :     if( pImg )
     126             :     {
     127           0 :         pImage = new Image( *pImg );
     128           0 :         pFtImage->SetImage( *pImage );
     129           0 :         pFtImage->SetStyle( ( pFtImage->GetStyle()/* | WB_NOTABSTOP */) & ~WB_3DLOOK );
     130           0 :         pFtImage->Show();
     131             :     }
     132             : 
     133           0 :     SetText( rText );
     134           0 :     pFtDescription->SetText( rDesc );
     135             : 
     136           0 :     pBtn1->SetClickHdl( LINK( this, SvxMessDialog, Button1Hdl ) );
     137           0 :     pBtn2->SetClickHdl( LINK( this, SvxMessDialog, Button2Hdl ) );
     138           0 : }
     139             : 
     140           0 : SvxMessDialog::~SvxMessDialog()
     141             : {
     142           0 :     delete pImage;
     143           0 : }
     144             : 
     145             : /*************************************************************************/
     146             : 
     147           0 : IMPL_LINK_NOARG_INLINE_START(SvxMessDialog, Button1Hdl)
     148             : {
     149           0 :     EndDialog( RET_BTN_1 );
     150           0 :     return 0;
     151             : }
     152           0 : IMPL_LINK_NOARG_INLINE_END(SvxMessDialog, Button1Hdl)
     153             : 
     154             : /*************************************************************************/
     155             : 
     156           0 : IMPL_LINK_NOARG_INLINE_START(SvxMessDialog, Button2Hdl)
     157             : {
     158           0 :     EndDialog( RET_BTN_2 );
     159           0 :     return 0;
     160             : }
     161           0 : IMPL_LINK_NOARG_INLINE_END(SvxMessDialog, Button2Hdl)
     162             : 
     163             : /*************************************************************************/
     164             : 
     165           0 : void SvxMessDialog::SetButtonText( sal_uInt16 nBtnId, const OUString& rNewTxt )
     166             : {
     167           0 :     switch ( nBtnId )
     168             :     {
     169             :         case MESS_BTN_1:
     170           0 :             pBtn1->SetText( rNewTxt );
     171           0 :             break;
     172             : 
     173             :         case MESS_BTN_2:
     174           0 :             pBtn2->SetText( rNewTxt );
     175           0 :             break;
     176             : 
     177             :         default:
     178             :             OSL_FAIL( "Invalid button number!!!" );
     179             :     }
     180           0 : }
     181             : 
     182             : 
     183             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10