added interfaces to build and added them to be exported

This commit is contained in:
rods%netscape.com 2000-02-09 19:25:44 +00:00
Родитель 1e663d9fba
Коммит 6815213416
5 изменённых файлов: 418 добавлений и 0 удалений

Просмотреть файл

@ -28,6 +28,10 @@ MODULE=raptor
EXPORTS = \
nsIXPBaseWindow.h \
nsIWindowListener.h \
nsIButton.h \
nsILabel.h \
nsICheckButton.h \
nsITextWidget.h \
$(NULL)
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -0,0 +1,63 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsIButton_h__
#define nsIButton_h__
#include "nsIWidget.h"
#include "nsString.h"
// {18032AD0-B265-11d1-AA2A-000000000000}
#define NS_IBUTTON_IID \
{ 0x18032ad0, 0xb265, 0x11d1, \
{ 0xaa, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
/**
* Push button widget.
* Automatically shows itself as depressed when clicked on.
*/
class nsIButton : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBUTTON_IID)
/**
* Set the label
*
* @param Set the label to aText
* @result NS_Ok if no errors
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result NS_Ok if no errors
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
};
#endif

Просмотреть файл

@ -0,0 +1,81 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsICheckButton_h__
#define nsICheckButton_h__
// {961085F5-BD28-11d1-97EF-00609703C14E}
#define NS_ICHECKBUTTON_IID \
{ 0x961085f5, 0xbd28, 0x11d1, { 0x97, 0xef, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
#include "nsISupports.h"
#include "nsIWidget.h"
/**
* Checkbox widget.
* Can show itself in a checked or unchecked state.
* The checkbox widget does not automatically show itself checked or unchecked when clicked on.
*/
class nsICheckButton : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHECKBUTTON_IID)
/**
* Set the button label
*
* @param aText button label
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
/**
* Set the check state.
* @param aState PR_TRUE show as checked. PR_FALSE show unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD SetState(const PRBool aState) = 0;
/**
* Get the check state.
* @param aState PR_TRUE if checked. PR_FALSE if unchecked.
* @result set to NS_OK if method successful
*/
NS_IMETHOD GetState(PRBool& aState) = 0;
};
#endif // nsICheckButton_h__

Просмотреть файл

@ -0,0 +1,91 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsILabel_h__
#define nsILabel_h__
#include "nsIWidget.h"
#include "nsString.h"
/* F3131891-3DC7-11d2-8DB8-00609703C14E */
#define NS_ILABEL_IID \
{ 0xf3131891, 0x3dc7, 0x11d2, \
{ 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
/**
* Label Alignments
*/
enum nsLabelAlignment {
eAlign_Right,
eAlign_Left,
eAlign_Center
};
struct nsLabelInitData : public nsWidgetInitData {
nsLabelInitData()
: mAlignment(eAlign_Left)
{
}
nsLabelAlignment mAlignment;
};
/**
* Label widget.
* Automatically shows itself as depressed when clicked on.
*/
class nsILabel : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILABEL_IID)
/**
* Set the label
*
* @param Set the label to aText
* @result NS_Ok if no errors
*/
NS_IMETHOD SetLabel(const nsString &aText) = 0;
/**
* Get the button label
*
* @param aBuffer contains label upon return
* @result NS_Ok if no errors
*/
NS_IMETHOD GetLabel(nsString &aBuffer) = 0;
/**
* Set the Label Alignemnt for creation
*
* @param aAlignment the alignment
* @result NS_Ok if no errors
*/
NS_IMETHOD SetAlignment(nsLabelAlignment aAlignment) = 0;
};
#endif

Просмотреть файл

@ -0,0 +1,179 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (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.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#ifndef nsITextWidget_h__
#define nsITextWidget_h__
#include "nsIWidget.h"
#include "nsString.h"
// {F8030011-C342-11d1-97F0-00609703C14E}
#define NS_ITEXTWIDGET_IID \
{ 0xf8030011, 0xc342, 0x11d1, { 0x97, 0xf0, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
struct nsTextWidgetInitData : public nsWidgetInitData {
nsTextWidgetInitData()
: mIsPassword(PR_FALSE),
mIsReadOnly(PR_FALSE)
{
}
PRBool mIsPassword;
PRBool mIsReadOnly;
};
/**
*
* Single line text editor.
* Unlike a nsIWidget, The text editor must automatically clear
* itself to the background color when paint messages are generated.
*
*/
class nsITextWidget : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITEXTWIDGET_IID)
/**
* Get the text of this component.
*
* @param aTextBuffer on return contains the text of this component
* @param aBufferSize the size of the buffer passed in
* @param aActualSize the number of char copied
* @result NS_Ok if no errors
*
*/
NS_IMETHOD GetText(nsString &aTextBuffer, PRUint32 aBufferSize, PRUint32& aActualSize) = 0;
/**
* Set the text of this component.
*
* @param aText -- an object containing a copy of the text
* @return the number of chars in the text string
* @result NS_Ok if no errors
*
*/
NS_IMETHOD SetText(const nsString &aText, PRUint32& aActualSize) = 0;
/**
* Insert text into this component.
* When aStartPos and aEndPos are a valid range this function performs a replace.
* When aStartPos and aEndPos are equal this function performs an insert.
* When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append.
* If aStartPos and aEndPos are out of range they are rounded to the closest end.
*
* @param aText the text to set
* @param aStartPos starting position for inserting text
* @param aEndPos ending position for inserting text
* @result NS_Ok if no errors
*/
NS_IMETHOD InsertText(const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32& aActualSize) = 0;
/**
* Remove any content from this text widget
* @result NS_Ok if no errors
*/
NS_IMETHOD RemoveText(void) = 0;
/**
* Indicates a password will be entered.
*
* @param aIsPassword PR_TRUE shows contents as asterisks. PR_FALSE shows
* contents as normal text.
* @result NS_Ok if no errors
*/
NS_IMETHOD SetPassword(PRBool aIsPassword) = 0;
/**
* Sets the maximum number of characters the widget can hold
*
* @param aChars maximum number of characters for this widget. if 0 then there isn't any limit
* @result NS_Ok if no errors
*/
NS_IMETHOD SetMaxTextLength(PRUint32 aChars) = 0;
/**
* Set the text widget to be read-only
*
* @param aReadOnlyFlag PR_TRUE the widget is read-only,
* PR_FALSE indicates the widget is writable.
* @param PR_TRUE if it was read only. PR_FALSE if it was writable
* @result NS_Ok if no errors
*/
NS_IMETHOD SetReadOnly(PRBool aNewReadOnlyFlag, PRBool& aOldReadOnlyFlag) = 0;
/**
* Select all of the contents
* @result NS_Ok if no errors
*/
NS_IMETHOD SelectAll() = 0;
/**
* Set the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetSelection(PRUint32 aStartSel, PRUint32 aEndSel) = 0;
/**
* Get the selection in this text component
* @param aStartSel starting selection position in characters
* @param aEndSel ending selection position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel) = 0;
/**
* Set the caret position
* @param aPosition caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD SetCaretPosition(PRUint32 aPosition) = 0;
/**
* Get the caret position
* @return caret position in characters
* @result NS_Ok if no errors
*/
NS_IMETHOD GetCaretPosition(PRUint32& aPosition) = 0;
};
#endif // nsITextWidget_h__