107 Commits

Author SHA1 Message Date
kin%netscape.com
0d49f312e2 Added ApplyStyleSheet() method to the various editor interfaces.
git-svn-id: svn://10.0.0.236/trunk@37845 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-01 19:32:35 +00:00
akkana%netscape.com
49826cb224 Oops, making wrapcolumn unsigned was a mistake. (Thanks to slamm's
warnings page for showing me that!)  Change it back to signed.


git-svn-id: svn://10.0.0.236/trunk@37746 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-01 19:01:04 +00:00
buster%netscape.com
0513dccdf4 0. possible fix for Sun build bustage.
1. IsEditable is much less hacky.  It basically says:
  1. if the node is a special bogus text node, it's not editable
  2. if the node is a text node with only newlines, then it's not editable
  3. if the node has no frame associated with it, then it is not editable
  4. otherwise, it is editable.
As part of this, I had to make IsEditable non-static.  This had some cascading effects on static methods that called
IsEditable, which likewise had to be made non-static.

2. SetTextProperties now works when the endpoints are leaf nodes (like images), not just text.  Charlie, you should
put this through some stress cases.


git-svn-id: svn://10.0.0.236/trunk@37741 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-01 18:42:28 +00:00
jfrancis%netscape.com
aaaa87a18c some cleanup and also selection enforcement for plaintext documents: selection is pinned to within the PRE tag on any edit action
git-svn-id: svn://10.0.0.236/trunk@37698 18797224-902f-48f8-a5cc-f745e15eee43
1999-07-01 13:42:03 +00:00
akkana%netscape.com
2fb45d996c - New dialog and editor shell API for Insert HTML Source
- Add wrapcolumn setting to document encoders, and use it in the editor
- Fix numbered lists in the html to text sink stream.


git-svn-id: svn://10.0.0.236/trunk@37529 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-30 19:26:08 +00:00
scc%netscape.com
a2d0be4d64 |nsISupports::GetIID()| --> |nsCOMTypeInfo<nsISupports>::GetIID()|
git-svn-id: svn://10.0.0.236/trunk@37444 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-29 21:01:31 +00:00
tague%netscape.com
ea708a16a8 Added clause and selection support for Input Methods. Fixes bug #8639, #8459, #6989, #7824
git-svn-id: svn://10.0.0.236/trunk@37435 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-29 20:31:22 +00:00
sfraser%netscape.com
1cd4f8b45d Add new aSelectionOnly param to Output routines
git-svn-id: svn://10.0.0.236/trunk@37424 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-29 20:14:24 +00:00
buster%netscape.com
a0e007d087 Moved GetTextSelectionOffsets and GetDocumentLength from nsTextEditRules to
nsTextEditor.  Added GetDocumentLength to nsITextEditor public interface.


git-svn-id: svn://10.0.0.236/trunk@37177 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-28 13:36:38 +00:00
akkana%netscape.com
bfcfe864dc Oops, use prettyprinting for OutputTextToStream as well as ToString.
git-svn-id: svn://10.0.0.236/trunk@36969 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-26 00:59:12 +00:00
akkana%netscape.com
2300ca567a - Add a prettyprint flag to the html-to-text sink (false by default).
When prettyprinting is on, we will attempt to make the plaintext
  mimic the look of the html; when off (as for copy/paste), we just
  dump the text with no formatting information.


git-svn-id: svn://10.0.0.236/trunk@36966 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-26 00:01:11 +00:00
buster%netscape.com
7391f40410 implemented most of max length handling
git-svn-id: svn://10.0.0.236/trunk@36964 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-25 22:57:26 +00:00
buster%netscape.com
ffacaa6f7d fixed Unix bustage. compare nsCOMPtr xxx.get() rather than just xxx
git-svn-id: svn://10.0.0.236/trunk@36793 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-25 00:28:28 +00:00
buster%netscape.com
09ba23297a quiet debug now
git-svn-id: svn://10.0.0.236/trunk@36771 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-24 23:50:53 +00:00
buster%netscape.com
5257d63875 added behavior for password fields
fixed a bunch of selection bugs


git-svn-id: svn://10.0.0.236/trunk@36768 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-24 23:37:55 +00:00
akkana%netscape.com
bebc77fffa Use new document encoding service from nsTextEditor, and make nsHTMLEditor methods call nsTextEditor methods
git-svn-id: svn://10.0.0.236/trunk@36698 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-24 20:16:36 +00:00
mcafee%netscape.com
1ce5a1bf28 Removing NEW_DRAG_AND_DROP ifdef, this is on by default now.
git-svn-id: svn://10.0.0.236/trunk@35674 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-16 05:18:53 +00:00
kin%netscape.com
38bb3e3ed2 * Added StartLogging() and StopLogging() methods to nsIEditor,
nsIHTMLEditor, nsITextEditor, and nsIEditorShell and enabled
  the "Start Log" and "End Log" menu items in the editor test bed.

* Modified makefiles for Unix and Win32 to turn on  Editor API Logging.

* Added action argument to the DeleteSelection() method in nsIEditorShell.

* Modified nsJSTxnLog to use nsJSEditorLog when writing it's output.


git-svn-id: svn://10.0.0.236/trunk@35149 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-14 20:02:46 +00:00
buster%netscape.com
91f2070891 changed the way nsEditProperty is used. Right now, it's our placeholder
for HTML and CSS atoms, since we can't get these from layout yet.  The old
use assumed one editor, but as we know many editors can exist simultaneously.
Now, the editors share a singleton which is fetched from a factory method,
saving memory and allocation overhead.


git-svn-id: svn://10.0.0.236/trunk@35033 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-12 21:15:14 +00:00
akkana%netscape.com
91f72d1f82 Implement InsertHTML.
Also, some minor fixes, like warning removal and addition of error checking
in files which needed it.


git-svn-id: svn://10.0.0.236/trunk@34645 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-10 21:31:42 +00:00
kin%netscape.com
87f40affc1 First pass checkin of the JavaScript editor logging mechanism. All changes are
ifdef'd with ENABLE_JS_EDITOR_LOG.


git-svn-id: svn://10.0.0.236/trunk@34611 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-10 19:41:40 +00:00
buster%netscape.com
4bad1b96b8 * Added nsAutoSelectionReset, a tiny class that resets the selection to what it was before a block transformation.
* Added some code to restore selection after RemoveTextProperty.
* Made a tiny change to the way the editor holds onto the transaction manager, so client (like the ender text control) can
turn undo on and off effectively
* Fixed a bug in IsNodeInline that was causing GetBlockParent to return the wrong parent node (and who knows what
other mischief) where atom compares were being done on strings of different case, for <B>, "b" vs. "B".  The DOM
method nsIDOMElement::GetTagName forced the returned tag name to upper case.  I don't know how long that has
been true, but I assume it's a fairly recent change (or something on our side related to it changed recently) or this method
never would have worked.  I also found a few cases of nsString::Equals that I changed to EqualsIgnoreCase
* Made some general improvements to the interaction between editors and rules, so that the aCancel out param is always
intialized, and all rules with Will... are matched with a Did... call.  Added Will/DidSetTextProperty() and
Will/DidRemoveTextProperty().  This helps enable plain text mode.  Added a skeleton for max length support in text editor.
* fixed some warnings.


git-svn-id: svn://10.0.0.236/trunk@34183 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-08 06:04:51 +00:00
akkana%netscape.com
d0e25f4a05 Get rid of overloaded class names, to eliminate warnings
git-svn-id: svn://10.0.0.236/trunk@34069 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-07 21:12:01 +00:00
bruce%cybersight.com
f92670e2de Correct typo, fix HP-UX bustage.
git-svn-id: svn://10.0.0.236/trunk@33220 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-29 02:15:07 +00:00
buster%netscape.com
9041cef161 Preparation for ender-based text control
* added focus listener.  Doesn't do much yet, but when focus notifications start appearing, we'll be ready for them.  The code is in
place to hide selection when we lose focus and paint selection when we get focus.  That's probably not quite right, but it's a start.
We will need to be able to determine the distinction between losing focus to another control within our app, and losing focus to
another app.
* added support for disabled and readonly states in the editor.  This is accomplished by having flags set by the client, and letting the
rules system deal with those flags.  The flags I added are:
     TEXT_EDITOR_FLAG_PLAINTEXT   0x01   // only plain text editing is allowed
     TEXT_EDITOR_FLAG_SINGLELINE  0x02   // enter key and CR-LF handled specially
     TEXT_EDITOR_FLAG_PASSWORD    0x04   // text is not entered into content, only a representative character
     TEXT_EDITOR_FLAG_READONLY    0x08   // editing events are disabled.  Editor may still accept focus.
     TEXT_EDITOR_FLAG_DISALBED    0x10   // all events are disabled (like scrolling).  Editor will not accept focus.
* added WillInsertBreak/DidInsertBreak into text rules, so flags could be checked.  This gets us readonly, disabled, and single line
behavior.
* cleaned up the code that allocates, registers, and destroys event listeners.  Thanks to Kin and Simon for cleaning up the
ownership model on the listeners, it was a big help.
* added support for a max text length.  You can now tell the text editor, be no bigger than n characters.


git-svn-id: svn://10.0.0.236/trunk@33153 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-28 21:24:18 +00:00
alecf%netscape.com
9d05a018f8 GetCharPref() is going away for nsIPref scriptability. Use CopyCharPref instead
git-svn-id: svn://10.0.0.236/trunk@33067 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-28 00:50:29 +00:00
sfraser%netscape.com
da0d7aa52f Removed obsolete IID definitions, use GetIID() instead.
git-svn-id: svn://10.0.0.236/trunk@33047 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-28 00:20:41 +00:00
sfraser%netscape.com
580f23cfb4 Add unit test call to nsIEditor, and implement it in nsText- and nsHTMLEditors.
git-svn-id: svn://10.0.0.236/trunk@32880 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-27 04:10:04 +00:00
akkana%netscape.com
156d763247 Insert / Paste as Quotation.
git-svn-id: svn://10.0.0.236/trunk@32824 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-27 00:08:15 +00:00
cmanske%netscape.com
eaea155fe6 Continued UI work: Spell checker fixes, toolbar improvements, popup menus implemented for paragraph style, font face and color, setting font color test UI, etc.
git-svn-id: svn://10.0.0.236/trunk@32726 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-26 21:40:51 +00:00
kin%netscape.com
31bd0fb412 Commented out all calls to HACKForceRedraw(). We now call it from
nsEditor::EndTransaction().


git-svn-id: svn://10.0.0.236/trunk@31897 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-17 13:31:56 +00:00
akkana%netscape.com
02dd28094a Change some comments re body wrap width
git-svn-id: svn://10.0.0.236/trunk@31639 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-14 19:25:43 +00:00
akkana%netscape.com
ad2018ef65 Implementations for new fcn Get/SetBodyWrapWidth
git-svn-id: svn://10.0.0.236/trunk@31472 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-13 22:11:05 +00:00
sfraser%netscape.com
4f8836e58a Stub in the get/set column width calls for plain text editing.
git-svn-id: svn://10.0.0.236/trunk@31409 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-13 04:44:57 +00:00
sfraser%netscape.com
ac1a4a233b Added file opening functionality
git-svn-id: svn://10.0.0.236/trunk@31300 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-12 22:24:47 +00:00
rods%netscape.com
7019b0e7c6 Added ifdef for installing DragListener
git-svn-id: svn://10.0.0.236/trunk@30710 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-07 19:41:32 +00:00
akkana%netscape.com
93cc772d77 Middle-mouse paste; also, fix a bunch of warnings
git-svn-id: svn://10.0.0.236/trunk@30696 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-07 19:22:38 +00:00
sfraser%netscape.com
76dcbace6f Fix a case typo in a header file name.
git-svn-id: svn://10.0.0.236/trunk@30676 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-07 05:26:50 +00:00
sfraser%netscape.com
ebe41203f5 Implement Save, Save As in editor.
git-svn-id: svn://10.0.0.236/trunk@30665 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-07 05:02:35 +00:00
akkana%netscape.com
392f2f0298 - Rename iDirection enum to ECollapsedSelectionAction
- Initial implementation of Insert HTML


git-svn-id: svn://10.0.0.236/trunk@30432 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-05 23:27:17 +00:00
buster%netscape.com
c59396c61b added a param to GetPriorNode and GetNextNode to tell these methods whether to use or skip
non-editable content.
added some comments, turned off some debugging flags.


git-svn-id: svn://10.0.0.236/trunk@30373 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-05 04:51:54 +00:00
buster%netscape.com
9a004fa0f0 1. block transformation infrastructure is now in place. We can go ahead and implement interesting
features like set paragraph style, set list type, indent, etc.  I'm sure there's holes in my
implementation that these high level features will make obvious.

2. I've factored a lot of utility methods from several modules into nsEditor as public static methods.
This makes them easily accessable to all, and will help Joe and I remove redundant methods.

3. I changed the HTML tags to lower case, and made all string compares case-insensitive.  No, this
isn't quite the right thing to do, but we don't have atoms from layout yet.  The Right Thing is for us
to reuse those atoms.


git-svn-id: svn://10.0.0.236/trunk@30367 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-05 04:05:19 +00:00
tague%netscape.com
6b3b505007 Fixed bug #5527 (Editor is not able to accumulate successive Japanese input)
git-svn-id: svn://10.0.0.236/trunk@30002 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-03 22:57:48 +00:00
sfraser%netscape.com
7ec5fb9eec Memory leak fixes for bug 5870. r mjudge, a chofmann.
git-svn-id: svn://10.0.0.236/trunk@30001 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-03 22:26:07 +00:00
kostello%netscape.com
0b56937bd5 Changed:
nsI*Editor::OutputText(nsString& aOutputString);
nsI*Editor::OutputHTML(nsString& aOutputString);

These methods always returns back a Unicode version of whatever is in the content model. It is the
responsibility of the caller then to call whatever converter is required to convert to the appropriate
charset.

Added:

nsI*Editor::OutputText(nsIOutputStream* aOutputStream, nsString* aCharsetOverride = nsnull)
nsI*Editor::OutputHTML(nsIOutputStream* aOutputStream, nsString* aCharsetOverride = nsnull)

These methods output the the current content model to aOutputStream. The document is encoded using the
document defined charset or if the user passes in a non-null value for aCharsetOverride then this
encoding overrides the encoding used by the document.


git-svn-id: svn://10.0.0.236/trunk@29967 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-03 18:48:39 +00:00
buster%netscape.com
68a1ee7d46 with permission from chofmann:
1. fix for bug 5796, crash on exit.  This was a bad, bad memory smudge on my part, easily fixed by doing the right ref counting in the
right places.

2. some preliminary code for M6 block transformations has leaked into this checkin.  It's safer than trying to re-code the fix above into
a fresh tree.  Unless you're making calls to do block transformations, you won't see any difference.


git-svn-id: svn://10.0.0.236/trunk@29897 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-30 22:40:18 +00:00
mjudge%netscape.com
9a8eb984ef hack to get redraw to work on setting bold or italics editor only
git-svn-id: svn://10.0.0.236/trunk@29813 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-30 00:06:40 +00:00
ftang%netscape.com
72ac644edf pass charset info from the current doc to the parser
git-svn-id: svn://10.0.0.236/trunk@29586 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-27 23:52:39 +00:00
jfrancis%netscape.com
8591f5670e more html typing rules implementation
git-svn-id: svn://10.0.0.236/trunk@29166 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-26 14:08:52 +00:00
rickg%netscape.com
8832f32e49 sync with nsString2
git-svn-id: svn://10.0.0.236/trunk@29011 18797224-902f-48f8-a5cc-f745e15eee43
1999-04-24 01:39:50 +00:00