X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-clipboard.cpp;h=1d06f25631726ff90ae53f38e3639b69d6d5093e;hp=bf347d509760008c9c2a330f57d63d174b8f073b;hb=399dfa8349a75c8c20e683620d927fd0f9420b85;hpb=fa6279fb2830427d5ab569ca14e6ade1557ef2fa diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp index bf347d5..1d06f25 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp @@ -1,24 +1,25 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ #include "toolkit-clipboard.h" // EXTERNAL INCLUDES #include - +#include namespace Dali { @@ -55,9 +56,9 @@ public: bool SetItem(const std::string &itemData); /** - * @copydoc Dali::Clipboard::GetItem() + * @copydoc Dali::Clipboard::RequestItem() */ - std::string GetItem( unsigned int index ); + void RequestItem(); /** * @copydoc Dali::Clipboard::NumberOfClipboardItems() @@ -74,20 +75,29 @@ public: */ void HideClipboard(); + /** + * @copydoc Dali::Clipboard::IsVisible() + */ + bool IsVisible() const; private: Clipboard( const Clipboard& ); Clipboard& operator=( Clipboard& ); static Dali::Clipboard mToolkitClipboard; + bool mVisible; + std::string mItem; + int mCount; }; // class clipboard Dali::Clipboard Dali::Internal::Adaptor::Clipboard::mToolkitClipboard; -Clipboard::Clipboard( /*Ecore_X_Window ecoreXwin*/) +Clipboard::Clipboard() { + mVisible = false; + mCount = 0; } Clipboard::~Clipboard() @@ -105,27 +115,40 @@ Dali::Clipboard Clipboard::Get() bool Clipboard::SetItem(const std::string &itemData ) { + mItem = itemData; + mCount = 1; return true; } -std::string Clipboard::GetItem( unsigned int index ) +void Clipboard::RequestItem() { - return ""; + Dali::ClipboardEventNotifier clipboardEventNotifier(Dali::ClipboardEventNotifier::Get()); + if ( clipboardEventNotifier ) + { + clipboardEventNotifier.SetContent( mItem ); + clipboardEventNotifier.EmitContentSelectedSignal(); + } } unsigned int Clipboard::NumberOfItems() { - return 0; + return mCount; } void Clipboard::ShowClipboard() { + mVisible = true; } void Clipboard::HideClipboard() { + mVisible = false; } +bool Clipboard::IsVisible() const +{ + return mVisible; +} } // namespace Adaptor @@ -169,9 +192,9 @@ bool Clipboard::SetItem( const std::string &itemData) return GetImplementation(*this).SetItem( itemData ); } -std::string Clipboard::GetItem( unsigned int index ) +void Clipboard::RequestItem() { - return GetImplementation(*this).GetItem( index ); + GetImplementation(*this).RequestItem(); } unsigned int Clipboard::NumberOfItems() @@ -189,4 +212,9 @@ void Clipboard::HideClipboard() GetImplementation(*this).HideClipboard(); } +bool Clipboard::IsVisible() const +{ + return GetImplementation(*this).IsVisible(); +} + } // namespace Dali