00001 /**************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (qt-info@nokia.com) 00006 ** 00007 ** $QT_BEGIN_LICENSE:LGPL$ 00008 ** Commercial Usage 00009 ** Licensees holding valid Qt Commercial licenses may use this file in 00010 ** accordance with the Qt Commercial License Agreement provided with the 00011 ** Software or, alternatively, in accordance with the terms contained in 00012 ** a written agreement between you and Nokia. 00013 ** 00014 ** GNU Lesser General Public License Usage 00015 ** Alternatively, this file may be used under the terms of the GNU Lesser 00016 ** General Public License version 2.1 as published by the Free Software 00017 ** Foundation and appearing in the file LICENSE.LGPL included in the 00018 ** packaging of this file. Please review the following information to 00019 ** ensure the GNU Lesser General Public License version 2.1 requirements 00020 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 00021 ** 00022 ** In addition, as a special exception, Nokia gives you certain additional 00023 ** rights. These rights are described in the Nokia Qt LGPL Exception 00024 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 00025 ** 00026 ** GNU General Public License Usage 00027 ** Alternatively, this file may be used under the terms of the GNU 00028 ** General Public License version 3.0 as published by the Free Software 00029 ** Foundation and appearing in the file LICENSE.GPL included in the 00030 ** packaging of this file. Please review the following information to 00031 ** ensure the GNU General Public License version 3.0 requirements will be 00032 ** met: http://www.gnu.org/copyleft/gpl.html. 00033 ** 00034 ** If you have questions regarding the use of this file, please contact 00035 ** Nokia at qt-info@nokia.com. 00036 ** $QT_END_LICENSE$ 00037 ** 00038 ****************************************************************************/ 00039 00040 import QtQuick 1.0 00041 00042 import "alarmserver.js" as AlarmServer 00043 00044 Item { 00045 id: button 00046 00047 property alias operation: buttonText.text 00048 property alias color: shade.color 00049 00050 signal clicked 00051 00052 Rectangle { 00053 id: shade 00054 anchors.fill: button 00055 border.color: "black" 00056 00057 Text { 00058 id: buttonText 00059 anchors.centerIn: parent 00060 style: Text.Sunken 00061 color: "white" 00062 } 00063 00064 MouseArea { 00065 id: mouseArea 00066 anchors.fill: parent 00067 onClicked: { 00068 AlarmServer.buttonPressed(operation); 00069 button.clicked() 00070 } 00071 } 00072 00073 states: State { 00074 name: "pressed"; when: mouseArea.pressed == true 00075 PropertyChanges { target: shade; opacity: .4 } 00076 } 00077 } 00078 } 00079 00080