92 lines
2.9 KiB
C++
92 lines
2.9 KiB
C++
/* -*- 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.0 (the "NPL"); you may not use this file except in
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
* http://www.mozilla.org/NPL/
|
|
*
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
* for the specific language governing rights and limitations under the
|
|
* NPL.
|
|
*
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
* Communications Corporation. Portions created by Netscape are
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
* Reserved.
|
|
*/
|
|
#ifndef nsFormFrame_h___
|
|
#define nsFormFrame_h___
|
|
|
|
#include "nsIFormManager.h"
|
|
#include "nsLeafFrame.h"
|
|
#include "nsVoidArray.h"
|
|
|
|
class nsString;
|
|
class nsIContent;
|
|
class nsIFrame;
|
|
class nsIPresContext;
|
|
struct nsReflowMetrics;
|
|
struct nsReflowState;
|
|
class nsFormControlFrame;
|
|
class nsRadioControlFrame;
|
|
class nsIFormControlFrame;
|
|
|
|
class nsFormFrame : public nsLeafFrame,
|
|
public nsIFormManager
|
|
{
|
|
public:
|
|
nsFormFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
|
|
|
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
|
|
nsReflowMetrics& aDesiredSize,
|
|
const nsReflowState& aReflowState,
|
|
nsReflowStatus& aStatus);
|
|
virtual ~nsFormFrame();
|
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
|
|
|
// nsIFormManager
|
|
|
|
NS_IMETHOD OnReset();
|
|
|
|
NS_IMETHOD OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame);
|
|
|
|
// other methods
|
|
|
|
void OnRadioChecked(nsRadioControlFrame& aRadio);
|
|
|
|
void Init(nsIPresContext& aPresContext, PRBool aReinit);
|
|
|
|
PRBool CanSubmit(nsFormControlFrame& aFrame);
|
|
|
|
NS_IMETHOD GetMethod(PRInt32* aMethod);
|
|
NS_IMETHOD GetEnctype(PRInt32* aEnctype);
|
|
NS_IMETHOD GetTarget(nsString* aTarget);
|
|
NS_IMETHOD GetAction(nsString* aAction);
|
|
|
|
|
|
protected:
|
|
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
|
NS_IMETHOD_(nsrefcnt) Release(void);
|
|
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
|
const nsReflowState& aReflowState,
|
|
nsReflowMetrics& aDesiredSize);
|
|
void RemoveRadioGroups();
|
|
void ProcessAsURLEncoded(PRBool aIsPost, nsString& aData);
|
|
void ProcessAsMultipart(nsString& aData);
|
|
static const char* GetFileNameWithinPath(char* aPathName);
|
|
|
|
// the following are temporary until nspr and/or netlib provide them
|
|
static Temp_GetTempDir(char* aTempDirName);
|
|
static char* Temp_GenerateTempFileName(PRInt32 aMaxSize, char* aBuffer);
|
|
static void Temp_GetContentType(char* aPathName, char* aContentType);
|
|
|
|
nsVoidArray mFormControls;
|
|
nsVoidArray mRadioGroups;
|
|
PRBool mInited;
|
|
nsIFormControlFrame* mTextSubmitter;
|
|
};
|
|
|
|
#endif // nsFormFrame_h___
|