fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / dlg / dlgctrls.cxx
blob28a5273d02ea22e6fcf4563fcaf84082ff4dc07c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "strings.hrc"
22 #include "dlgctrls.hxx"
23 #include "sdresid.hxx"
24 #include "fadedef.h"
25 #include "sdpage.hxx"
27 using namespace ::sd;
28 using namespace ::rtl;
30 struct FadeEffectLBImpl
32 std::vector< TransitionPresetPtr > maPresets;
35 FadeEffectLB::FadeEffectLB( Window* pParent, SdResId Id )
36 : ListBox( pParent, Id ),
37 mpImpl( new FadeEffectLBImpl )
41 FadeEffectLB::~FadeEffectLB()
43 delete mpImpl;
46 void FadeEffectLB::Fill()
48 TransitionPresetPtr pPreset;
50 InsertEntry( String( SdResId( STR_EFFECT_NONE ) ) );
51 mpImpl->maPresets.push_back( pPreset );
53 const TransitionPresetList& rPresetList = TransitionPreset::getTransitionPresetList();
54 TransitionPresetList::const_iterator aIter;
55 for( aIter = rPresetList.begin(); aIter != rPresetList.end(); ++aIter )
57 pPreset = (*aIter);
58 const OUString aUIName( pPreset->getUIName() );
59 if( !aUIName.isEmpty() )
61 InsertEntry( aUIName );
62 mpImpl->maPresets.push_back( pPreset );
66 SelectEntryPos(0);
70 // -----------------------------------------------------------------------------
72 void FadeEffectLB::applySelected( SdPage* pSlide ) const
74 const sal_uInt16 nPos = GetSelectEntryPos();
76 if( pSlide && (nPos < mpImpl->maPresets.size() ) )
78 TransitionPresetPtr pPreset( mpImpl->maPresets[nPos] );
80 if( pPreset.get() )
82 pPreset->apply( pSlide );
84 else
86 pSlide->setTransitionType( 0 );
87 pSlide->setTransitionSubtype( 0 );
88 pSlide->setTransitionDirection( sal_True );
89 pSlide->setTransitionFadeColor( 0 );
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */