CN115061616A - Document view switching method and device and electronic equipment - Google Patents

Document view switching method and device and electronic equipment Download PDF

Info

Publication number
CN115061616A
CN115061616A CN202210632045.5A CN202210632045A CN115061616A CN 115061616 A CN115061616 A CN 115061616A CN 202210632045 A CN202210632045 A CN 202210632045A CN 115061616 A CN115061616 A CN 115061616A
Authority
CN
China
Prior art keywords
view
block node
type
text
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210632045.5A
Other languages
Chinese (zh)
Inventor
邹俊辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210632045.5A priority Critical patent/CN115061616A/en
Publication of CN115061616A publication Critical patent/CN115061616A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing

Abstract

The embodiment of the application discloses a document view switching method and device and electronic equipment. One embodiment of the method comprises: receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document consists of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched; and converting the current view based on the view type of the current view and the view type to be converted, and displaying the converted view. The implementation mode realizes the function of switching the views in the document, and enriches the display form of the document content.

Description

Document view switching method and device and electronic equipment
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a document view switching method and device and electronic equipment.
Background
Documents serve as a platform for content management, and contain a variety of contents such as pictures, files, texts, and the like. The content in the existing document product can only be displayed in a single display form, and a user cannot switch the display mode of the displayed content, so that the richness of the document content is limited.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a document view switching method and device and electronic equipment, which realize the function of switching views in a document and enrich the display form of document content.
In a first aspect, an embodiment of the present disclosure provides a document view switching method, including: receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document consists of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched; and converting the current view based on the view type of the current view and the view type to be converted, and displaying the converted view.
In a second aspect, an embodiment of the present disclosure provides a document view switching apparatus, including: the view switching method comprises the steps that a receiving unit is used for receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document is composed of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched; and the conversion unit is used for converting the current view and displaying the converted view based on the view type of the current view and the view type to be converted.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the document view switching method according to the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the document view switching method according to the first aspect.
According to the document view switching method, the document view switching device and the electronic equipment, by receiving the view switching instruction for the current view of the target block node in the document, the current view can be switched based on the view type of the current view and the view type to be switched, and the switched view is displayed. By the method, the function of switching the views in the document is realized, and the display form of the document content is enriched.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow diagram for one embodiment of a document view switching method according to the present disclosure;
FIG. 2 is a schematic illustration of one text view of a document view switching method according to the present disclosure;
FIG. 3 is a schematic diagram of one card view of a document view switching method according to the present disclosure;
FIG. 4 is a schematic illustration of a preview view of a document view switching method according to the present disclosure;
FIG. 5 is a flow diagram of yet another embodiment of a document view switching method according to the present disclosure;
FIG. 6 is a schematic diagram of one application scenario of a document view switching method according to the present disclosure;
FIG. 7 is a flow diagram of yet another embodiment of a document view switching method according to the present disclosure;
FIG. 8 is a schematic diagram of yet another application scenario of a document view switching method according to the present disclosure;
FIG. 9 is a flow diagram of another embodiment of a document view switching method according to the present disclosure;
FIG. 10 is a schematic diagram of another application scenario of a document view switching method according to the present disclosure;
FIG. 11 is a flow chart diagram of yet another embodiment of a document view switching method according to the present disclosure;
FIG. 12 is a schematic diagram of yet another application scenario of a document view switching method according to the present disclosure;
FIG. 13 is a schematic block diagram of one embodiment of a document view switching apparatus according to the present disclosure;
FIG. 14 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;
FIG. 15 is a schematic block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Referring to FIG. 1, a flow 100 of one embodiment of a document view switching method according to the present disclosure is shown. The document view switching method comprises the following steps:
step 101, receiving a view switching instruction for a current view of a target block node in a document.
In this embodiment, the execution subject of the document view switching method may receive a view switching instruction for a current view of a target block node in a document. The view switching instruction may include a view type to be switched, and the view type may include, but is not limited to: a text view, a card view, and a preview view. Here, the objects of view switching may include, but are not limited to: files, pictures, text, and video.
If the object of view switching is a file, the text view shows the related text of the file, such as the title of the file. The card view is used for displaying relevant information of the file in a card form, such as a file title, a file format, a file size and the like. The preview view may be in the form of a window showing information about the document through which the user may browse the document's details.
If the object of view switching is a picture, the text view shows the related text of the picture, for example, the title of the picture. The card view is used for displaying relevant information of the picture in a card form, such as picture title, picture format, picture size and the like. The preview view may be a picture presented in the form of a window.
And if the object of view switching is a text, displaying the text content of the text view. The card view is a view showing text content, such as keywords of text, text size, and the like, in the form of a card. The preview view may be textual content presented in the form of a window.
If the object of view switching is a video, the text view shows the relevant text of the video, for example, the video title. The card view is a view showing relevant information of a video in the form of a card, such as a video title, a video format, a video size, and the like. The preview view may be a video to-be-played interface displayed in the form of a window.
As shown in fig. 2, fig. 2 shows a schematic diagram of one text view of a document view switching method according to the present disclosure. In fig. 2, the text view presents the title of the file, "file 1" and the file format "docx".
As shown in fig. 3, fig. 3 shows a schematic diagram of one card view of the document view switching method according to the present disclosure. In fig. 3, the card view includes a file title "file 1" and a file format "docx" as shown by an icon 301, a file size "15.21 KB" as shown by an icon 302, a picture characterizing the file format as shown by an icon 303, a preview icon as shown by an icon 304, and a download icon as shown by an icon 305.
As shown in fig. 4, fig. 4 is a schematic view showing one preview view of a document view switching method according to the present disclosure. In fig. 4, a preview view is shown in the form of a window, which includes the file title "file 1" and file format "docx" shown by icon 401 and the contents of the file as shown by icon 402. The user can browse the contents of the document in detail by dragging the scroll bar shown by the icon 403.
Here, the above-mentioned document is generally composed of at least one block node. Here, the type of the block node is generally various, for example, a file block node, a text block node, and the like. In particular, the file block node typically represents the relevant content of the file, and the text block node typically represents the text content. When a user inserts a block node in a document, the type of block node may be selected.
As an example, if a user performs an operation of inserting a block node, a block node type selection control may be presented, if the user selects a "file" icon in the block node type selection control, the file selection control may be presented, and if the user selects "file 1" on the file selection control, the execution main body may insert a file block node in a file, where the content of "file 1" is presented.
Here, the target block node is generally a switchable view type block node, that is, the target block node has a capability of switching a view. The execution body can realize the display of different views by transforming the data structure of the current view.
As an example, after the target block node is inserted into the document, the execution body may pop up a view switching selection control. And the user can switch the current view of the target block node through the popped view switching selection control.
And 102, converting the current view based on the view type of the current view and the view type to be converted, and displaying the converted view.
In this embodiment, the executing body may convert the current view based on the view type of the current view and the view type to be converted, and display the converted view.
Here, if the view type of the current view is a text type and the view type to be converted is a card type, the execution main body may convert the view from the text view to the card view. If the view type of the current view is a card type and the view type to be converted is a text type, the execution main body may convert the view from the card view to the text view. If the view type of the current view is a text type and the view type to be converted is a preview type, the execution main body may convert the view from the text view to the preview view. If the view type of the current view is a preview type and the view type to be converted is a text type, the execution body may convert the view from the preview view to the text view. If the view type of the current view is a card type and the view type to be converted is a preview type, the execution main body may convert the view from the card view to the preview view. If the view type of the current view is a preview type and the view type to be converted is a card type, the execution main body may convert the view from the preview view to the card view.
The method provided by the above embodiment of the present disclosure may be configured to, by receiving a view switching instruction for a current view of a target block node in a document, convert the current view based on a view type of the current view and a view type to be converted, and display the converted view. By the method, the function of switching the views in the document is realized, and the display form of the document content is enriched.
In some optional implementations, the executing body may convert the current view based on the view type of the current view and the view type to be converted by: the execution body may convert a text type block node into a card type or preview type block node. Here, after the user inputs a text in a text block node in a document, the entire text block node may be used as a target block node, and view switching may be performed on the target block node, for example, the target block node may be switched to a card type block node, or the target block node may be switched to a preview type block node; the newly input characters in the text block node can also be used as target block nodes, and the view switching is carried out on the target block nodes, so that the view switching can be carried out on the content blocks of the text type.
In some optional implementation manners, the view type to be converted may be a card type or a preview type, and in this case, usually, the target block node is a view block node, and the view block node corresponds to a target object block node. Here, the target object may include, but is not limited to, at least one of: files, pictures, text, and video. The execution body may display the converted view in the following manner: the execution subject may obtain an identifier of a target object block node corresponding to the view block node. Here, one view block node corresponds to one target object block node, and when creating the target object block node, the execution subject may create one view block node, and usually add an identifier of the created target object block node to the son field corresponding to the view block node, and since the view block node includes two view types, i.e., a card type and a preview type, the target object block node may inherit the view type of the view block node, so that the card view and the preview view may be presented. Then, the executing entity may obtain the object data of the target object block node by using the identifier of the target object block node, for example, if the target object is a file, the file data includes but is not limited to: file title, file format, file size, and details in the file. Finally, the execution body may render and present a view using the object data and the view type to be converted, thereby presenting the related content of the target object in the view type to be converted.
In some optional implementations, before receiving a view switching instruction for a current view of a target block node in a document, the executing body may further receive a new instruction for newly creating the target block node in the document, where the new instruction generally includes an identifier of a target object to be displayed. Here, the user may click an icon for creating a block node, and then, may present a block node type selection page, and if the user selects a "target object" icon in the block node type selection page, the target object selection page may be presented, and the user may select a target object to be displayed in the target object selection page. At this time, the execution body may receive a new instruction to newly create a target block node in the document. Then, the execution agent may construct data of the target block node. By way of example, if the target object is a file, the constructed data of the target block node may include, but is not limited to: identification of the file, title of the file, format of the file, and size of the file. Finally, the executing entity may insert the target block node into the document by using the constructed data of the target block node, where the view content of the current view of the inserted target block node is usually the object information of the target object indicated by the identifier of the target object to be displayed.
It should be noted that the current view of the inserted target block node may be preset based on the file format, for example, the initial view of the file in the "json" format may be a preview view, and the initial view of the file in the "xml" format may be a card view.
In some alternative implementations, the constructed target block nodes may be view block nodes whose attributes typically include a view type. The execution body may construct data of the target block node by: the execution body may construct data of the target object block node. Here, the data of the constructed target object block node may include, but is not limited to: identification of the target object, title of the target object, format of the target object, and size of the target object. Then, the execution body may construct data of the view block node, and associate the constructed view block node with the constructed target object block node. Specifically, the execution subject may associate the view block node with the target object block node by adding an identifier of the corresponding target object block node in a child field of the view block node and adding an identifier of the corresponding view block node in a parent field of the target object block node.
In some optional implementations, the target block node may be a target object block node, and in this case, the attribute of the target object block node includes a view type, and the view type includes a card type and a preview type.
In some optional implementations, the execution subject may receive the view switching instruction for the current view of the target block node in the document by: the execution body may detect whether a user hovers a mouse pointer over a target block node in the document, and if so, may present a view switching control. As an example, the view switching control may include: icons for switching views to text views, icons for switching views to card views, and icons for switching views to preview views. Then, the execution body may detect whether the user performs a click operation on the presented view switching control, and if so, may determine the received view switching instruction for the current view of the target block node. As an example, if the user clicks an icon for switching the view into the text view in the view switching control, it may be determined that the type of the view to be converted is a text type; if the user clicks an icon for switching the view into the card view in the view switching control, determining that the view type to be converted is the card type; if the user clicks an icon for switching the view into the preview view in the view switching control, it may be determined that the type of the view to be converted is the preview type.
With further reference to FIG. 5, a flow 500 of yet another embodiment of a document view switching method is shown. The process 500 of the document view switching method includes the following steps:
step 501, a view switching instruction for a current view of a target block node in a document is received.
In this embodiment, step 501 may be performed in a manner similar to step 101, and is not described herein again.
It should be noted that the target block node may be a view block node, and the attribute of the view block node may include a view type, where the view type may include a card type and a preview type.
Here, the view type of the current view may be one of a card type and a preview type, and the view type to be converted may be the other of the card type and the preview type. That is, if the view type of the current view is a card type, the view type to be converted is a preview type. And if the view type of the current view is a preview type, the view type to be converted is a card type.
Step 502, the view type corresponding to the view block node is changed from the view type of the current view to the view type to be converted.
In this embodiment, the executing body of the document view switching method may change the view type corresponding to the view block node from the view type of the current view to the view type to be converted.
As an example, if the view type of the current view is a card type and the view type to be converted is a preview type, the execution subject may convert the view type of the view block node from the card type to the preview type. If the view type of the current view is a preview type and the view type to be converted is a card type, the execution main body may convert the view type of the view block node from the preview type to the card type.
As can be seen from fig. 5, compared with the embodiment corresponding to fig. 1, the flow 500 of the document view switching method in this embodiment embodies a step of updating a view type corresponding to a view block node when converting a card view into a preview view or converting a preview view into a card view. Therefore, the scheme described in the embodiment can realize the mutual conversion between the card view and the preview view.
With continued reference to fig. 6, fig. 6 is a schematic diagram of an application scenario of the document view switching method according to the present embodiment. In the application scenario of fig. 6, the current view 601 is a card view, and if the user clicks a preview icon (an icon for switching the view into the preview view) in the presented view switching control 602, at this time, the current view may be switched from the card view 601 to the preview view, as shown by an icon 603.
With continued reference to FIG. 7, a flow 700 of yet another embodiment of a document view switching method is shown. The process 700 of the document view switching method includes the following steps:
step 701, receiving a view switching instruction for a current view of a target block node in a document.
In this embodiment, step 701 may be performed in a manner similar to step 101, and is not described herein again.
It should be noted that the target block node may be a text block node, the view type of the current view is usually a text type, and the view type to be converted is usually a card type or a preview type.
Step 702, delete text block node.
In this embodiment, the executing body of the document view switching method may delete the text block node, that is, delete the target block node in the document. Specifically, since the data in the text block node of the switchable view is usually a blank character, the execution main body may delete the text block node by deleting the blank character and deleting the attribute information used in rendering.
And step 703, newly building a view block node as a target block node, and setting the view type of the newly built view block node as the view type to be converted.
In this embodiment, the execution body may newly create a view block node as a target block node at the deletion position of the text block node, and set the view type of the newly created view block node as the view type to be converted. As an example, if the view type to be converted is a card type, the view type of the newly created view block node may be set as the card type. If the view type to be converted is a preview type, the view type of the newly-built view block node can be set as the preview type.
As can be seen from fig. 7, compared with the embodiment corresponding to fig. 1, the flow 700 of the document view switching method in this embodiment embodies the steps of deleting a text block node, newly creating a view block node as a target block node at the deletion position of the text block node, and setting the view type to be converted. Thus, the scheme described in the embodiment can realize the conversion of the view from the text type to the card type or the preview type.
Referring further to fig. 8, fig. 8 is a schematic diagram of still another application scenario of the document view switching method according to the present embodiment. In the application scenario of fig. 8, the current view 801 is a text view, and if the user clicks a card icon (an icon for switching the view into the card view) in the presented view switching control 802, at this time, the current view may be switched from the text view 801 into the card view, as shown by an icon 803.
With continued reference to FIG. 9, a flow 900 of another embodiment of a document view switching method is shown. The process 900 of the document view switching method includes the following steps:
step 901, receive a view switching instruction for a current view of a target block node in a document.
In this embodiment, step 901 may be performed in a similar manner to step 101, and will not be described herein again.
It should be noted that the target block node may be an intra-line node of the text block node, that is, the text presented in the target block node is located in the same line as other texts. By way of example, the text presented in the target block node may precede the other text, follow the other text, and be located between the other text. The view type of the current view is usually a text type, and the view type to be converted is usually a card type or a preview type.
And step 902, deleting the target block node in the text block nodes.
In the present embodiment, the execution subject of the document view switching method may delete the above-described target block node from the text block nodes. Specifically, since the data of the target block node of the switchable view in the text block node is usually a blank character, the execution subject may delete the target block node by deleting the blank character and deleting the attribute information used in rendering.
And 903, performing cutting-off operation on the text block nodes at the deletion positions of the target block nodes, so that each cut-off text block node individually occupies one line.
In this embodiment, the execution body may execute a cutting operation on the text block node at the deletion position of the target block node, so that each cut text block node occupies one line individually.
For example, if the target block node is located in the middle of other texts, the execution body may cut the text block node, so that the text before the target block node occupies one line alone, and the text after the target block node occupies one line alone.
If the target block node is located before other texts, the execution body may cut the text block node, so that the text located after the target block node occupies one line.
If the target block node is located behind another text, the execution body may cut the text block node, so that the text located in front of the target block node occupies one line.
And 904, at the cut part of the text block node, newly building a view block node as a target block node, and setting the view type of the newly built view block node as the view type to be converted.
In this embodiment, the execution body may newly create a view block node as a target block node at the cut-off of the text block node, and set the view type of the newly created view block node as the view type to be converted. As an example, if the view type to be converted is a card type, the view type of the newly created view block node may be set as the card type. If the view type to be converted is a preview type, the view type of the newly-built view block node can be set as the preview type.
It should be noted that the newly created view block node usually occupies one row alone.
As an example, if the target block node is located in the middle of other texts, the other texts located before the target block node, the newly created view block node, and the other texts located after the target block node respectively occupy one line, and occupy three lines in total.
And if the target block node is positioned in front of other texts, the newly-built view block node and other texts positioned behind the target block node respectively occupy one line and occupy two lines in total.
And if the target block node is positioned behind other texts, the other texts positioned in front of the target block node and the newly-built view block node respectively occupy one line and two lines in total.
As can be seen from fig. 9, compared with the embodiment corresponding to fig. 1, the process 900 of the document view switching method in this embodiment represents a step that, when the target block node is an inline node of a text block node, the text block node needs to be cut off, and a new view block node is created at the cut off position as the target block node. Therefore, the scheme described in the embodiment can realize that the view is converted from the text type to the card type or the preview type when the target block node is the intra-line node of the text block node.
Referring further to fig. 10, fig. 10 is a schematic diagram of another application scenario of the document view switching method according to the present embodiment. In the application scenario of fig. 10, the current view 1001 is a text view, and if the user clicks a card icon (an icon for switching the view into the card view) in the presented view switching control 1002, at this time, the current view may be switched from the text view 1001 to the card view, as shown by an icon 1003. It should be noted that, since the current text view is located between text 123 and text 456, after view switching, text 123, switched card view 1003, and text 456 each occupy one line individually.
With continued reference to FIG. 11, a flow 1100 of yet another embodiment of a document view switching method is shown. The process 1100 of the document view switching method includes the following steps:
step 1101, receiving a view switching instruction for a current view of a target block node in a document.
In this embodiment, step 1101 may be performed in a manner similar to step 101, and will not be described herein again.
It should be noted that the target block node may be a view block node, and the attribute of the view block node may include a view type, and the view type may include a card type and a preview type. Here, the view type of the current view is usually a card type or a preview type, and the view type to be converted is usually a text type.
And 1102, deleting the view block nodes, taking the newly-built text block nodes as target block nodes at the deletion positions of the view block nodes, and presenting corresponding text views in the newly-built text block nodes.
In this embodiment, the executing body of the document view switching method may delete the view block node, that is, delete the target block node in the document. Thereafter, at the deletion position of the above-mentioned view block node, a new text block node may be created as a target block node, and a corresponding text view, for example, a file title and a file format of a file may be presented in the new text block node.
As can be seen from fig. 11, compared with the embodiment corresponding to fig. 1, a process 1100 of the document view switching method in this embodiment embodies the steps of deleting a view block node and creating a new text block node when converting a card view or a preview view into a text view. Thus, the scheme described in the embodiment can realize the conversion of the view from the card type or the preview type to the text type.
Referring further to fig. 12, fig. 12 is a schematic diagram of still another application scenario of the document view switching method according to the present embodiment. In the application scenario of fig. 12, the current view 1201 is a preview view, and if the user clicks a text icon (an icon for switching the view into the text view) in the presented view switching control 1202, at this time, the current view may be switched from the preview view 1201 into the text view, as shown by an icon 1203.
With further reference to fig. 13, as an implementation of the method shown in the above figures, the present application provides an embodiment of a document view switching apparatus, which corresponds to the embodiment of the method shown in fig. 1, and which is particularly applicable to various electronic devices.
As shown in fig. 13, the document view switching apparatus 1300 of the present embodiment includes: a receiving unit 1301 and a converting unit 1302. In fact, the receiving unit 1301 is configured to receive a view switching instruction for a current view of a target block node in a document, where the document is composed of at least one block node, the target block node is a block node capable of switching a view type, and the view switching instruction includes a view type to be switched; the conversion unit 1302 is configured to convert the current view based on the view type of the current view and the view type to be converted, and display the converted view.
In this embodiment, specific processing of the receiving unit 1301 and the converting unit 1302 of the document view switching apparatus 1300 may refer to step 101 and step 102 in the corresponding embodiment of fig. 1.
In some optional implementations, the target block node is a view block node, the attribute of the view block node includes a view type, the view type includes a card type and a preview type, the view type of the current view is one of the card type and the preview type, and the view type to be converted is the other of the card type and the preview type; and the converting unit 1302 may be further configured to convert the current view based on the view type of the current view and the view type to be converted, as follows: the converting unit 1302 may change the view type corresponding to the view block node from the view type of the current view to the view type to be converted.
In some optional implementations, the converting unit 1302 may be further configured to convert the current view based on the view type of the current view and the view type to be converted, as follows: the above-described conversion unit 1302 may convert a text type block node into a card type or preview type block node.
In some optional implementation manners, the target block node is a text block node, the view type of the current view is a text type, and the view type to be converted is a card type or a preview type; and the above-mentioned conversion unit 1302 may be further configured to convert the text type block node into a card type or preview type block node by: the conversion unit 1302 may delete the text block node; and then, a new view block node can be created as a target block node, and the view type of the newly created view block node is set as the view type to be converted.
In some optional implementations, the target block node is an intra-line node of a text block node, a text presented in the target block node and other texts are located in the same line, the view type of the current view is a text type, and the view type to be converted is a card type or a preview type; and the above-mentioned converting unit 1302 may be further configured to convert the text type block node into a card type or preview type block node by: the conversion unit 1302 may delete the target block node from the text block nodes; then, at the deletion position of the target block node, a cutting operation may be performed on the text block node, so that each text block node obtained by cutting occupies one line separately; then, at the cut-off position of the text block node, a new view block node is used as a target block node, and the view type of the new view block node is set as the view type to be converted, wherein the new view block node occupies one row separately.
In some optional implementations, the target block node is a view block node, the attribute of the view block node includes a view type, the view type includes a card type and a preview type, the view type of the current view is the card type or the preview type, and the view type to be converted is a text type; and the converting unit 1302 may be further configured to convert the current view based on the view type of the current view and the view type to be converted, as follows: and deleting the view block nodes, taking the newly-built text block nodes as target block nodes at the deletion positions of the view block nodes, and presenting corresponding text views in the newly-built text block nodes.
In some optional implementation manners, the view type to be converted is a card type or a preview type, the target block node is a view block node, and the view block node corresponds to a target object block node; and the above-mentioned conversion unit 1302 may be further configured to display the converted view by: the conversion unit 1302 may obtain an identifier of a target object block node corresponding to the view block node; then, the object data of the target object block node can be obtained by using the identifier; and then, rendering and presenting the view by using the object data and the view type to be converted.
In some optional implementations, the document view switching apparatus 1300 may further include: a new instruction receiving unit (not shown in the figure), a construction unit (not shown in the figure), and an insertion unit (not shown in the figure). The new instruction receiving unit is used for receiving a new instruction for newly creating a target block node in the document, wherein the new instruction comprises an identifier of a target object to be displayed; the construction unit is used for constructing the data of the target block node; the inserting unit is configured to insert the target block node into the document by using the constructed data of the target block node, where the view content of the current view of the inserted target block node is object information of the target object indicated by the identifier of the target object to be displayed.
In some alternative implementations, the constructed target block node is a view block node, and the attribute of the view block node includes a view type; and the constructing unit may be further configured to construct the data of the target block node by: firstly, data of a target object block node can be constructed; thereafter, data for view block nodes may be constructed, associating the constructed view block nodes with constructed target object block nodes.
In some optional implementations, the target block node is a target object block node, and the attribute of the target object block node includes a view type.
In some optional implementations, the receiving unit 1301 may be further configured to receive a view switching instruction for a current view of a target block node in the document by: the receiving unit 1301 may present a view switching control in response to detecting a mouse hovering operation for a target block node in the document; and then, in response to detecting the click operation on the view switching control, determining the received view switching instruction for the current view of the target block node.
FIG. 14 illustrates an exemplary system architecture 1400 to which embodiments of the document view switching method of the present disclosure may be applied.
As shown in fig. 14, system architecture 1400 may include terminal devices 1411, 1412, 1413, network 142 and server 143. Network 142 is the medium used to provide communication links between terminal devices 1411, 1412, 1413 and server 143. Network 142 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 1411, 1412, 1413 to interact with server 143 over network 142 to send or receive messages, etc., e.g., server 143 may provide various files to terminal devices 1411, 1412, 1413 for download. Various communication client applications, such as a document editing application, an instant messaging software, and the like, may be installed on the terminal devices 1411, 1412, 1413.
The terminal equipment 1411, 1412 and 1413 receives a view switching instruction of a user for a current view of a target block node in a document; then, the current view may be converted based on the view type of the current view and the view type to be converted, and the converted view may be displayed.
The terminal devices 1411, 1412, 1413 may be hardware or software. When the terminal devices 1411, 1412, 1413 are hardware, they may be various electronic devices having display screens and supporting information interaction, including but not limited to smart phones, tablet computers, laptop portable computers, and the like. When the terminal devices 1411, 1412 and 1413 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 143 may be hardware or software. When the server 143 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 143 is software, it may be implemented as multiple pieces of software or software modules (for example, to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the document view switching method provided by the embodiment of the present disclosure is generally executed by the terminal devices 1411, 1412, 1413, and the document view switching device is generally disposed in the terminal devices 1411, 1412, 1413.
It should be understood that the number of terminal devices, networks, and servers in fig. 14 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to fig. 15, shown is a schematic diagram of an electronic device (e.g., the terminal device of fig. 14) suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 15 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 15, an electronic device may include a processing apparatus (e.g., a central processing unit, a graphics processor, etc.) 1501 which may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1502 or a program loaded from a storage apparatus 1508 into a Random Access Memory (RAM) 1503. In the RAM 1503, various programs and data necessary for the operation of the electronic apparatus 1500 are also stored. The processing device 1501, the ROM 1502, and the RAM 1503 are connected to each other by a bus 1504. An input/output (I/O) interface 1505 is also connected to bus 1504.
Generally, the following devices may be connected to I/O interface 1505: input devices 1506 including, for example, touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; an output device 1507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 1508 including, for example, magnetic tape, hard disk, etc.; and a communication device 1509. The communication device 1509 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 15 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1509, or installed from the storage device 1508, or installed from the ROM 1502. The computer program, when executed by the processing means 1501, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document consists of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched; and converting the current view based on the view type of the current view and the view type to be converted, and displaying the converted view.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself, for example, a receiving element may also be described as an "element that receives a view switching instruction for the current view of a target block node in a document".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (14)

1. A document view switching method is characterized by comprising the following steps:
receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document consists of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched;
and converting the current view based on the view type of the current view and the view type to be converted, and displaying the converted view.
2. The method according to claim 1, wherein the target block node is a view block node, the attributes of the view block node include a view type, the view type includes a card type and a preview type, the view type of the current view is one of the card type and the preview type, and the view type to be converted is the other of the card type and the preview type; and
the converting the current view based on the view type of the current view and the view type to be converted comprises:
and changing the view type corresponding to the view block node from the view type of the current view to the view type to be converted.
3. The method according to claim 1, wherein the converting the current view based on the view type of the current view and the view type to be converted comprises:
the text type block node is converted into a card type or preview type block node.
4. The method according to claim 3, wherein the target block node is a text block node, the view type of the current view is a text type, and the view type to be converted is a card type or a preview type; and
the converting the text type block node into the card type or preview type block node includes:
deleting the text block node;
and newly building a view block node as a target block node, and setting the view type of the newly built view block node as the view type to be converted.
5. The method according to claim 3, wherein the target block node is an intra-line node of a text block node, the text presented in the target block node is in the same line with other text, the view type of the current view is a text type, and the view type to be converted is a card type or a preview type; and
the converting the text type block node into the card type or preview type block node includes:
deleting the target block node in the text block nodes;
at the deletion position of the target block node, performing cutting-off operation on the text block node, so that each text block node obtained by cutting-off independently occupies one line;
and at the cut-off part of the text block node, newly building a view block node as a target block node, and setting the view type of the newly built view block node as the view type to be converted, wherein the newly built view block node occupies one line independently.
6. The method according to claim 1, wherein the target block node is a view block node, the attributes of the view block node include a view type, the view type includes a card type and a preview type, the view type of the current view is the card type or the preview type, and the view type to be converted is a text type; and
the converting the current view based on the view type of the current view and the view type to be converted comprises:
and deleting the view block nodes, newly building a text block node as a target block node at the deletion position of the view block node, and presenting a corresponding text view in the newly built text block node.
7. The method according to claim 1, wherein the view type to be converted is a card type or a preview type, the target block node is a view block node, and the view block node corresponds to a target object block node; and
the displaying the translated view includes:
acquiring an identifier of a target object block node corresponding to the view block node;
acquiring object data of a target object block node by using the identifier;
and rendering and presenting the view by using the object data and the view type to be converted.
8. The method of claim 1, wherein prior to said receiving a view switching instruction for a current view of a target block node in a document, the method further comprises:
receiving a new instruction for newly building a target block node in the document, wherein the new instruction comprises an identifier of a target object to be displayed;
constructing data of the target block node;
and inserting the target block node into the document by using the constructed data of the target block node, wherein the view content of the current view of the inserted target block node is the object information of the target object indicated by the identifier of the target object to be displayed.
9. The method of claim 8, wherein the constructed target block node is a view block node, and wherein the attributes of the view block node include a view type; and
the constructing data of the target block node comprises:
constructing data of a target object block node;
and constructing data of the view block nodes, and associating the constructed view block nodes with the constructed target object block nodes.
10. The method of claim 8, wherein the target block node is a target object block node, and wherein the attribute of the target object block node comprises a view type.
11. The method of claim 1, wherein receiving a view switching instruction for a current view of a target block node in a document comprises:
presenting a view switching control in response to detecting a mouse-over operation for a target block node in the document;
in response to detecting a click operation on the view switching control, determining a received view switching instruction for a current view of the target block node.
12. A document view switching apparatus, comprising:
the view switching method comprises the steps that a receiving unit is used for receiving a view switching instruction aiming at a current view of a target block node in a document, wherein the document consists of at least one block node, the target block node is a block node with a switchable view type, and the view switching instruction comprises a view type to be switched;
and the conversion unit is used for converting the current view and displaying the converted view based on the view type of the current view and the view type to be converted.
13. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-11.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-11.
CN202210632045.5A 2022-06-02 2022-06-02 Document view switching method and device and electronic equipment Pending CN115061616A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210632045.5A CN115061616A (en) 2022-06-02 2022-06-02 Document view switching method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210632045.5A CN115061616A (en) 2022-06-02 2022-06-02 Document view switching method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115061616A true CN115061616A (en) 2022-09-16

Family

ID=83199881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210632045.5A Pending CN115061616A (en) 2022-06-02 2022-06-02 Document view switching method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115061616A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042684A1 (en) * 2008-08-13 2010-02-18 Managed Interface Technologies LLC Adaptive user interfaces and methods for displaying, accessing, and organizing electronic assets
CN110100251A (en) * 2016-12-30 2019-08-06 华为技术有限公司 For handling the equipment, method and graphic user interface of document
CN113011140A (en) * 2021-02-10 2021-06-22 北京字跳网络技术有限公司 View display method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042684A1 (en) * 2008-08-13 2010-02-18 Managed Interface Technologies LLC Adaptive user interfaces and methods for displaying, accessing, and organizing electronic assets
CN110100251A (en) * 2016-12-30 2019-08-06 华为技术有限公司 For handling the equipment, method and graphic user interface of document
CN113011140A (en) * 2021-02-10 2021-06-22 北京字跳网络技术有限公司 View display method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN112433654B (en) Page display method and device, electronic equipment and computer readable medium
CN109491742B (en) Page table rendering method and device
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN110658960A (en) Message processing method and device and electronic equipment
CN115145560B (en) Business orchestration method, apparatus, device, computer-readable medium, and program product
CN114565476A (en) Information processing method, device, terminal and storage medium
CN113157153A (en) Content sharing method and device, electronic equipment and computer readable storage medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN112035030A (en) Information display method and device and electronic equipment
CN111857720A (en) Method and device for generating user interface state information, electronic equipment and medium
CN111273830A (en) Data display method and device, electronic equipment and computer readable medium
WO2023207543A1 (en) Media content publishing method and apparatus, and device, storage medium and program product
CN112380819A (en) Document editing method and device and electronic equipment
CN111756953A (en) Video processing method, device, equipment and computer readable medium
CN115113787B (en) Message processing method, device, equipment and medium
CN112307393A (en) Information issuing method and device and electronic equipment
CN115017110A (en) Information processing method, device, terminal and storage medium
CN113011140A (en) View display method and device and electronic equipment
CN112579218B (en) User interface display method and device, computer readable medium and electronic equipment
CN114995690A (en) Document creation method, device, equipment and storage medium
CN115061616A (en) Document view switching method and device and electronic equipment
CN112417276A (en) Paging data acquisition method and device, electronic equipment and computer readable storage medium
CN111753238A (en) Data mapping method and device and electronic equipment
CN115061601A (en) Electronic document processing method and device, terminal and storage medium
CN111324349A (en) Method, device, terminal and storage medium for generating interactive interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination